Setu-TS
    Preparing search index...

    Interface IQueryBus

    Registers and executes queries.

    0.1.0

    interface IQueryBus {
        execute<TResult = unknown>(query: CqrsQuery): Promise<TResult>;
        register<TQuery extends CqrsQuery<unknown>, TResult>(
            type: string,
            handler: IQueryHandler<TQuery, TResult>,
        ): void;
    }

    Implemented by

    Index
    • Executes a query.

      Type Parameters

      • TResult = unknown

        The expected result type

      Parameters

      Returns Promise<TResult>

      The handler's result

      (from the plugin) — as a REJECTION — if no handler is registered for query.type

      — as a REJECTION — if query.type is not a string