Skip to content

Variable: onGarbageCollected()

const onGarbageCollected: (target, callback, unregisterToken?) => void

Registers a callback to be executed when the target object is garbage collected

Parameters

target

WeakKey

The object to watch for garbage collection

callback

() => void

Function to execute when target is collected

unregisterToken?

WeakKey

Optional token for unregistering the callback

Returns

void

Released under the MIT License.