class QueryBus<QueryBase extends IQuery = IQuery> extends ObservableBus implements IQueryBus {
publisher: IQueryPublisher<QueryBase>
execute<T extends QueryBase, TResult = any>(query: T): Promise<TResult>
bind<T extends QueryBase, TResult = any>(handler: IQueryHandler<T, TResult>, queryId: string)
register(handlers: Type<IQueryHandler<QueryBase, QueryResultBase>>[] = [])
protected registerHandler(handler: Type<IQueryHandler<QueryBase, QueryResultBase>>)
constructor()
protected _subject$: Subject<T>
subject$
}
Methods
execute()
|
execute<T extends QueryBase, TResult = any>(query: T): Promise<TResult>
Parameters
Option |
Type |
Description |
query
|
T |
|
Returns
Promise<TResult>
|
bind()
|
bind<T extends QueryBase, TResult = any>(handler: IQueryHandler<T, TResult>, queryId: string)
Parameters
|
register()
|
register(handlers: Type<IQueryHandler<QueryBase, QueryResultBase>>[] = [])
Parameters
Option |
Type |
Description |
handlers
|
Type>[] |
Optional. Default is [] .
|
|
registerHandler()
|
protected registerHandler(handler: Type<IQueryHandler<QueryBase, QueryResultBase>>)
Parameters
Option |
Type |
Description |
handler
|
Type> |
|
|