adopt
Adds a value and associated disposal callback as a resource to the stack.
Return
The provided value.
Parameters
value
The value to add.
onDispose
The callback to use in place of a [Symbol.dispose]() method. Will be invoked with value as the first parameter.