-
Notifications
You must be signed in to change notification settings - Fork 71
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
[Typescript] combineEvents forces invalid type #331
Comments
I've spent longer on this than I probably should have, but should anyone be interested, I've created the following module to replace the types.
The benefit of doing this, is that I can now write the following:
And all of the types are correctly inferred, action is inferred as MyCustomAction using the following module example:
It just means that everything is typed correctly and VSCode will give you some nice help when working out which action type to accept |
This is a...
Which version of Redux Beacon are you using?
Which target(s) are you using?
🪲 What are the steps to reproduce your issue?
🪲 What did you expect to happen?
I should be able to provide a custom type to the action.
🪲 What happened instead?
Typescript is unable to assign MyCustomAction to { [key:string]: any }, Example:
😄 The larger picture
It looks as though GoogleAnalytics typescript types also override the Action in their EventDefinitions, therefore not allowing you to provide a custom type.
I think this needs to be addressed in a few places:
combineEvents:
Should become:
google-analytics-gtag/event-helpers
Should become:
perhaps, I'm wrong/missing something and perhaps this is all because of my setup - would be good to get some feedback 😄
Can you help out?
The text was updated successfully, but these errors were encountered: