Skip to content

DisposeHook · Core API

type DisposeHook<T> = (instance) => void | Promise<void>;

Cleanup hook called for a cached instance during container disposal.

Transient providers cannot use disposal hooks because their instances are not cached or tracked by the container.

Type Parameter

T

Parameter Type

instance

T

void | Promise<void>