You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every proxy created by Comlink has the [releaseProxy]() method. Calling it will detach the proxy and the exposed object from the message channel, allowing both ends to be garbage collected.
The docs should maybe say that every Remote created by a wrap has a [releaseProxy]() method.
The text was updated successfully, but these errors were encountered:
ivancuric
changed the title
"Proxy" is a loaded term, especially considering releaseProxy. Should be named Remote.
"Proxy" is a loaded term in the docs. Should be named Remote when referring to symbol methods
Mar 7, 2023
wrap() is what returns a proxy. `proxy() is just a marker function that says a value should be proxied across the boundary. You are right that the docs should be better here. I actually like the idea of adding types to the docs and using the type names to disambiguate.
However this isn't true. This won't work:
One would think that the return type of a
proxy
function would count as a proxy, but it's not.Only
Remote
types have theProxyMethods
on them:https://github.com/GoogleChromeLabs/comlink/blob/main/src/comlink.ts#LL138C8-L138C8
The docs should maybe say that every
Remote
created by awrap
has a[releaseProxy]()
method.The text was updated successfully, but these errors were encountered: