Skip to content

Commit

Permalink
Merge pull request #103 from webpack/feature/name
Browse files Browse the repository at this point in the history
add name to hook interface
  • Loading branch information
sokra authored Jul 9, 2019
2 parents 577543a + acfb72e commit b6e5be9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Hook {
Object.assign({}, options, typeof opt === "string" ? { name: opt } : opt);

return {
name: this.name,
tap: (opt, fn) => this.tap(mergeOptions(opt), fn),
tapAsync: (opt, fn) => this.tapAsync(mergeOptions(opt), fn),
tapPromise: (opt, fn) => this.tapPromise(mergeOptions(opt), fn),
Expand Down
1 change: 1 addition & 0 deletions tapable.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type ArgumentNames<T extends any[]> = FixedSizeArray<T["length"], string>;

declare class Hook<T, R> {
constructor(args?: ArgumentNames<AsArray<T>>, name?: string);
name: string | undefined;
intercept(interceptor: HookInterceptor<Hook<T, R>>): void;
isUsed(): boolean;
callAsync(...args: Append<AsArray<T>, Callback<Error, R>>): void;
Expand Down

0 comments on commit b6e5be9

Please sign in to comment.