Skip to content

Commit

Permalink
Merge pull request #1825 from strongloop/fix/listener-type
Browse files Browse the repository at this point in the history
Add default generic arg value to `Listener` type
  • Loading branch information
bajtos committed Mar 2, 2020
2 parents dcfda58 + 92654f6 commit 65a3586
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 PersistedModel> {
[property: string]: any;
}

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

export interface ObserverMixin {
/**
Expand Down

0 comments on commit 65a3586

Please sign in to comment.