DisposableStack

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
external val disposed: Boolean

Returns a value indicating whether this stack has been disposed.

Functions

Link copied to clipboard
Link copied to clipboard
external fun <T : JsAny?> adopt(value: T, onDispose: (value: T) -> Unit): T

Adds a value and associated disposal callback as a resource to the stack.

Link copied to clipboard
external fun defer(onDispose: () -> Unit)

Adds a callback to be invoked when the stack is disposed.

Link copied to clipboard
external fun dispose()

Disposes each resource in the stack in the reverse order that they were added.

Link copied to clipboard
external fun move(): DisposableStack

Move all resources out of this stack and into a new DisposableStack, and marks this stack as disposed.

Link copied to clipboard
external fun <T : Disposable?> use(value: T): T

Adds a disposable resource to the stack, returning the resource.