ste-signals
Version:
Add the power of Signals to your projects. They are the most bare bones implementation of an event.
37 lines (36 loc) • 1.07 kB
TypeScript
import { DispatcherBase, IPropagationStatus } from "ste-core";
import { ISignal, ISignalHandler } from ".";
/**
* The dispatcher handles the storage of subsciptions and facilitates
* subscription, unsubscription and dispatching of a signal event.
*
* @export
* @class SignalDispatcher
* @extends {DispatcherBase<ISignalHandler>}
* @implements {ISignal}
*/
export declare class SignalDispatcher extends DispatcherBase<ISignalHandler> implements ISignal {
/**
* Dispatches the signal.
*
* @returns {IPropagationStatus} The status of the signal.
*
* @memberOf SignalDispatcher
*/
dispatch(): IPropagationStatus;
/**
* Dispatches the signal without waiting for the result.
*
* @memberOf SignalDispatcher
*/
dispatchAsync(): void;
/**
* Creates an event from the dispatcher. Will return the dispatcher
* in a wrapper. This will prevent exposure of any dispatcher methods.
*
* @returns {ISignal} The signal.
*
* @memberOf SignalDispatcher
*/
asEvent(): ISignal;
}