Skip to content

Commit

Permalink
feat(hooks): use app hooks (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lxxyx authored Nov 9, 2020
1 parent 968735a commit faf05c5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/faas/src/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { FaaSContext, IFaaSApplication } from './interface';
import { FaaSContext, IMidwayFaaSApplication } from './interface';

/**
* Stability: 1 - Experimental
*/
export class MidwayHooks {
private readonly ctx: FaaSContext;
private readonly app: IFaaSApplication;
private readonly app: IMidwayFaaSApplication;

constructor(ctx: FaaSContext, app: IFaaSApplication) {
constructor(ctx: FaaSContext, app: IMidwayFaaSApplication) {
this.ctx = ctx;
this.app = app;
}
Expand All @@ -31,4 +31,8 @@ export class MidwayHooks {
usePlugin(key: string) {
return this.ctx[key] || this.app[key];
}

useApp() {
return this.app;
}
}

0 comments on commit faf05c5

Please sign in to comment.