You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to take a look if TypeScript offers a convenient way to add type-safe hooks, but otherwise we will probably need overloads taking a string literal as type and delegating them to the hook, like this:
// Current code, renamed to _hook but stays unchanged._hook(plugin: Plugin,hookName: string,callback: Callback, ...matchers: any[]){}// More specific overloads per hook.hook(plugin: Plugin,hookName: "http",callback: Callback,matcher: RegExp|string){this._hook(plugin,hookName,callback,matcher);}// etc...hook(plugin: Plugin,hookName: "ember-component",callback: Callback,matcher: string){this._hook(plugin,hookName,callback,matcher);}
The text was updated successfully, but these errors were encountered:
I need to take a look if TypeScript offers a convenient way to add type-safe hooks, but otherwise we will probably need overloads taking a string literal as type and delegating them to the hook, like this:
The text was updated successfully, but these errors were encountered: