-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type 'HooksT' does not satisfy the constraint 'Record<string, any>' #62
Comments
@pi0 What do you think about that? It looks like it's a problem when TS is in strict mode |
i created |
3 tasks
Bump |
KaelWD
added a commit
to vuetifyjs/vuetify
that referenced
this issue
Feb 21, 2023
In my project it works in strict mode using: import { Hookable, HookCallback, createHooks } from 'hookable';
export enum Hook {
READY = 'ready',
}
export interface HookTypes extends Record<string, HookCallback> {
[Hook.READY]: () => void;
}
const hooks = createHooks<HookTypes>();
hooks.addHooks({
[Hook.READY]: async () => console.log('🔌', Hook.READY),
});
hooks.callHook(Hook.READY); Stackblitz: https://hookable-typescript-strict.stackblitz.io |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Reproduction
Minimal reproduction
Run
yarn run build
ortsc
.Describe the bug
A PR for this issue will be submitted
When compiling with
tsc
, everything gets compiled correctly, but we receive this error message:Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: