• Eduardo Sanz García's avatar
    Use `WeakMap` to store `MessageChannel` · 0c0a639b
    Eduardo Sanz García authored
    We use `Window` objects as keys on a map. Windows can be removed.
    `WeakMap` has the characteristic that keys that are claimed by the
    garbage collector are removed from the map. In this way, we are memory
    friendly and don't retain any defunct object.
    0c0a639b
port-provider.js 8.85 KB