Skip to content
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

InputControl: See if reducer actions can be typed better #43945

Open
mirka opened this issue Sep 7, 2022 · 0 comments
Open

InputControl: See if reducer actions can be typed better #43945

mirka opened this issue Sep 7, 2022 · 0 comments
Labels
[Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality

Comments

@mirka
Copy link
Member

mirka commented Sep 7, 2022

What problem does this address?

Reducer functions currently require a bit of typecasting to result in valid TypeScript, since the action's event is not typed according to the specific triggering action.

Some examples

What is your proposed solution?

See if we can use generics to type the actions so consumers can use type narrowing to get the correct event type in their reducer functions.

@mirka mirka added [Type] Code Quality Issues or PRs that relate to code quality [Package] Components /packages/components labels Sep 7, 2022
@mirka mirka added this to Inbox (needs triage) 📬 in WordPress Components via automation Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Code Quality Issues or PRs that relate to code quality
Projects
WordPress Components
Inbox (needs triage) 📬
Development

No branches or pull requests

1 participant