Comparing version 0.7.0 to 0.7.1
@@ -8,3 +8,3 @@ import Emittery from 'emittery'; | ||
removeHook(event: string, handler: Hook): void; | ||
hook(event: string, ...data: any[]): Promise<void>; | ||
hook<T>(event: string, ...arguments_: T[]): Promise<void>; | ||
get hooks(): Map<string, Hook[]>; | ||
@@ -11,0 +11,0 @@ getHooks(event: string): Hook[] | undefined; |
@@ -29,3 +29,3 @@ import Emittery from 'emittery'; | ||
// Triggers all handlers for a specific event with provided data | ||
async hook(event, ...data) { | ||
async hook(event, ...arguments_) { | ||
const eventHandlers = this._hooks.get(event); | ||
@@ -35,4 +35,4 @@ if (eventHandlers) { | ||
try { | ||
// eslint-disable-next-line no-await-in-loop, @typescript-eslint/no-unsafe-argument | ||
await handler(...data); | ||
// eslint-disable-next-line no-await-in-loop | ||
await handler(...arguments_); | ||
} | ||
@@ -39,0 +39,0 @@ catch (error) { |
{ | ||
"name": "hookified", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Event and Middleware Hooks", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9496