interface MessageChannelNetworkAdapterConfig {
    useWeakRef?: boolean;
}

Properties

Properties

useWeakRef?: boolean

This is an optional parameter to use a weak ref to reference the message port that is passed to the adapter. This option is useful when using a message channel with a shared worker. If you use a network adapter with useWeakRef = true in the shared worker and in the main thread network adapters with strong refs the network adapter will be automatically garbage collected if you close a page. The garbage collection doesn't happen immediately; there might be some time in between when the page is closed and when the port is garbage collected