Skip to content

EnabledSymbol

const EnabledSymbol: unique symbol;

Defined in: symbols.ts:36

Symbol key for whether a defer/deferSync is enabled: true while disposing would still run its cleanup (not canceled, not yet disposed). Same value as its .enabled property.

import { EnabledSymbol, defer } from "@xtandard/lib";
const cleanup = defer(() => console.log("cleanup"));
cleanup[EnabledSymbol]; // true
cleanup.cancel();
cleanup[EnabledSymbol]; // false