@samatawy/rules
    Preparing search index...

    Interface ICommandHandler

    interface ICommandHandler {
        addAction(action: ICommandAction): any;
        executeDeferred(): Promise<any>;
    }

    Implemented by

    Index

    Methods

    • Add an action to the handler. Each action must have a unique hash that identifies it. If an action with the same hash is already registered, an error will be thrown. If the action is marked as immediate, it will be executed immediately using the associated plugin. If the action is deferred, it will be stored for later execution when executeDeferred() is called.

      Parameters

      Returns any

      the result of the action if it is immediate, or true if it is deferred.

      an error if an action with the same hash is already registered.

    • Execute all deferred actions that have been added to the handler. This should be called after processing rules to ensure that all deferred command actions are executed.

      Returns Promise<any>

      A promise that resolves when all deferred actions have been executed.