Skip to content

Commit

Permalink
Add default generic arg value to Listener type
Browse files Browse the repository at this point in the history
The changes introduced by dcfda58 may break existing consumers
of our typings. This commit fixes this problem by adding a default
value to the recently introduced generic argument of `Listener` type.

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
  • Loading branch information
bajtos committed Feb 28, 2020
1 parent 6c38347 commit a0f95a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion types/observer-mixin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export interface OperationHookContext<T extends typeof ModelBase> {
[property: string]: any;
}

export type Listener<Ctx> = (ctx: Ctx, next: (err?: any) => void) => void;
export type Listener<Ctx = OperationHookContext<typeof ModelBase>> = (
ctx: Ctx, next: (err?: any) => void
) => void;

export interface ObserverMixin {
/**
Expand Down

0 comments on commit a0f95a5

Please sign in to comment.