-
Notifications
You must be signed in to change notification settings - Fork 142
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
Why must an action "NOT include properties other than type, payload, and error, and meta"? #40
Comments
You could easily namespace inside the |
they do go through the middleware chain. Each middleware can modify the object. The object isn't a a string or a number, so unless we're using the Immutable library, can totally be mutating. But that doesn't really matter because each middleware can return an entirely different object as well, but after having done whatever they want to "it," including assigning to the |
The reducer being a Pure function, it should not really make changes to the action either. I agree with @aCandidMind middleware should not change action.
The user is not necessary using an immutable library for state either, but the reducer should not change the state anyway. UPDATE: It's not really possible to do. e.g. |
Lack of other action props is preventing me integrating this awesome module with redux-optimist, which seems to expect Would you consider allow other action prop types if only to interface with other excellent modules? |
I for example have built a history management package that changes URLs based on action types and a routing config map. Using middleware, I add
location
andprevLocation
keys to payloads, but I rather pass them as keys on the action, so that the payload would be what it was before adding my middleware. So would it really be a crime for a package to add additional keys?ps. I could add my keys to
meta
, but I feel like too many other packages are possibly hijacking that, and could break what I've put on themeta
key. That basically summarizes the benefits of allowing for additional keys--package authors can essentially namespace their "meta" data and therefore do a better job of preventing it from being fooled with. Perhaps it's just best application developers stick to these conventions so that they can take advantage of the larger number of supporting packages that conform to the FSA standard, but package developers can make the choice to opt out of such benefits if they choose.The text was updated successfully, but these errors were encountered: