@fabric-es/fabric-cqrs
Version:
Hyperledger Fabric middleware for event sourcing and cqrs pattern
14 lines (13 loc) • 564 B
TypeScript
import { Action, Store } from 'redux';
import type { Logger } from 'winston';
import type { HandlerResponse } from './handlerResponse';
export declare type DispatcherOptions = {
name: string;
store: Store;
slice: string;
SuccessAction: string;
ErrorAction?: string;
logger: Logger;
typeGuard?: (input: any) => boolean;
};
export declare type Dispatcher = <TResult, TArg>(actionDispatcher: (payload: any) => Action, options: DispatcherOptions, onSuccess?: (result: any) => TResult) => (args?: TArg) => Promise<HandlerResponse<TResult>>;