-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
root action #33
Comments
I've just found this issue, I think it should help you: piotrwitek/typesafe-actions#4 |
Hello @lsentkiewicz I'm in the middle of rework of entire action creators and reducer section as I made a few improvements in typing patterns for them, so expect a new solution soon. At this moment you can check the issue linked above or check the RootAction file that is located in the Playground Project: https://github.com/piotrwitek/react-redux-typescript-guide/blob/master/playground/src/redux/root-action.ts |
Please check a new and updated Store Configuration Section |
thanks @piotrwitek! |
In the current readme.md export const allActions = {
...countersAC,
...todosAC,
...toastsAC,
};
const returnOfActions =
Object.values(allActions).map(getReturnOfExpression); should be changed to export const allActions = [
...Object.values(countersAC),
...Object.values(todosAC),
...Object.values(toastsAC),
];
const returnOfActions = allActions.map(getReturnOfExpression); because multiple modules can contain the same names. |
@lsentkiewicz yes that make sense, thanks! |
I am confused how to create the root action properly.
From docs:
CountersActions[keyof CountersActions]
is equal to action creator types, not action types.Should I define both action creator and actions separately?
Also
ToastsActions[keyof ToastsActions];
doesn't work, buttypeof ToastsActions[keyof typeof ToastsActions];
works.The text was updated successfully, but these errors were encountered: