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
{{ message }}
This repository was archived by the owner on Jan 25, 2022. It is now read-only.
const weakObjs = new WeakSet([], objectAboutToBeCollected => {
// here do something with the object right before it is going to be collected,e.g.
objectAboutToBeCollected.dispose();
// or if objectAboutToBeCollected is attached to a live object then collection is cancelled,
// this method will be called again when it is ready to be collected once more
});
same for WeakMap
if listening for an object finalization is no longer needed then it can just be removed from the set / the set can be collected