UNPKG

ste-core

Version:
30 lines (29 loc) 1.01 kB
import { ISubscription } from "./ISubscription"; /** * Stores a handler. Manages execution meta data. * @class Subscription * @template TEventHandler */ export declare class Subscription<TEventHandler> implements ISubscription<TEventHandler> { handler: TEventHandler; isOnce: boolean; /** * Indicates if the subscription has been executed before. */ isExecuted: boolean; /** * Creates an instance of Subscription. * * @param {TEventHandler} handler The handler for the subscription. * @param {boolean} isOnce Indicates if the handler should only be executed once. */ constructor(handler: TEventHandler, isOnce: boolean); /** * Executes the handler. * * @param {boolean} executeAsync True if the even should be executed async. * @param {*} scope The scope the scope of the event. * @param {IArguments} args The arguments for the event. */ execute(executeAsync: boolean, scope: any, args: IArguments): void; }