-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add support for an error
field to createAction
#207
Comments
When I started working with your library, I naturally tried to pass an instance of So when I'm reading this:
I definitely agree 👍 |
@ncuillery thanks for your feedback Part 1) is quite complex and most probably will need my expertise |
Is your feature request related to a real problem or use-case?
Add support for an
error
field tocreateAction
so it is compliant with Flux standard action specification.This will open the possibility to use
typesafe-actions
with other solutions or applications that are relying on that pattern.Describe a solution including usage in code example
Most probably an optional error field added to the base Action type:
I would go with a forced convention by having a payload to be an instance of Error (easy to implement, backward compatible does not change API and I think that's the most popular option)
This would automatically set the
error
property to true, but also it could allow leveraging conditional types to refine Action type even further to show or hide error property from the action type. That would be the most optimal solution.Who does this impact? Who is this for?
All users
Describe alternatives you've considered (optional)
Additional context (optional)
Related #108
The text was updated successfully, but these errors were encountered: