Represents a resource that can be cooperatively torn down via a destroy method.

This minimal structural contract is used to generalize cancellation handling across streams and other lifecycle managed objects without coupling to specific implementations.

type Destroyable = {
    destroy?: (error?: any) => void;
}
Index

Properties

Properties

destroy?: (error?: any) => void

Optional method to terminate the resource and perform cleanup.