Interface for objects that support deferral of actions.

Deferral allows temporary postponement of trouble handling or other actions. Deferred items can be cleared to restore normal processing. This is useful for managing low-priority issues during critical operations.

Example

class DeferrableTrouble implements DeferAware {
shouldDefer = false;
deferred = false;

defer() {
this.deferred = true;
console.log('Trouble deferred');
}

clearDefer() {
this.deferred = false;
console.log('Deferral cleared');
}
}

// Usage
if (trouble.shouldDefer && !trouble.deferred) {
trouble.defer();
}
interface DeferAware {
    shouldDefer: boolean;
    deferred: boolean;
    defer: VoidFunction;
    clearDefer: VoidFunction;
}

Hierarchy (view full)

Properties

shouldDefer: boolean

Whether this item should be deferred based on current conditions

deferred: boolean

Current deferral state

defer: VoidFunction

Defers the item, preventing normal processing

clearDefer: VoidFunction

Clears the deferral, allowing normal processing to resume