GoogleChromeLabs / GoogleChromeLabs/comlink

Q: Should I release proxy()-wrapped callbacks?

Open
#590 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
12.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

The language in the README is a bit confusing because proxies refer to wrapped workers but there's also the `proxy()` method to wrap callbacks:

```javascript
const worker = Comlink.wrap( new Worker(/* ... */) );
const callback = Comlink.proxy( result => {

});
worker.doWorkAndReport( callback );
```

Should I do `callback[ Comlink.releaseProxy ]();` when I no longer need the callback?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.