Skip to content

Commit

Permalink
Merge pull request #9674 from dkonasov/message-handler-type
Browse files Browse the repository at this point in the history
fix(microservices): Fixed typings for MessageHandler
  • Loading branch information
kamilmysliwiec authored Jun 15, 2022
2 parents b29d88f + e8e22ac commit 42a538e
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Observable } from 'rxjs';

export interface MessageHandler<TInput = any, TContext = any, TResult = any> {
(data: TInput, ctx?: TContext): Promise<Observable<TResult>>;
next?: (data: TInput, ctx?: TContext) => Promise<Observable<TResult>>;
(data: TInput, ctx?: TContext):
| Promise<Observable<TResult>>
| Promise<TResult>;
next?: (
data: TInput,
ctx?: TContext,
) => Promise<Observable<TResult>> | Promise<TResult>;
isEventHandler?: boolean;
extras?: Record<string, any>;
}

0 comments on commit 42a538e

Please sign in to comment.