Skip to content

fixed bug where all events had to have handlers in hooks#193

Open
jdpigeon wants to merge 1 commit into
FelixHenninger:mainfrom
jdpigeon:dano/hook-types
Open

fixed bug where all events had to have handlers in hooks#193
jdpigeon wants to merge 1 commit into
FelixHenninger:mainfrom
jdpigeon:dano/hook-types

Conversation

@jdpigeon
Copy link
Copy Markdown
Contributor

I was trying to use the hooks option to set some logic today and discovered that the typing is wrong currently and requires handlers to be provided for ALL event types if using this option:

// ...
        hooks: {
          run: eventHandler,
        },
// Throwing error related to missing ""before:prepare", prepare, render, end", etc.
// ...

This type change allows the previous code to be valid

@jdpigeon
Copy link
Copy Markdown
Contributor Author

Unlike most index signatures, I think this requires all instances of EventName to be present specifically because the index signature is an enum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant