• Eduardo Sanz García's avatar
    Make PortProvider#listen a private method · c5e02b31
    Eduardo Sanz García authored
    I can't see any negative consequence of starting to listen to
    postMessage discovery message immediately after `PortProvider` is
    instantiated. (In fact, this is what it was currently happening). These
    messages won't be lost, and the `PortRPC`s won't create the
    communication channels before the RPC methods are registered.
    
    On the other hand, it simplifies the use of `PortProvider` and
    eliminates the potential problem of `PortProvider#listen` been called
    more than once.
    c5e02b31
port-provider-test.js 5.77 KB