You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a feature-based model for organizing code. The general idea is that you put Components, Actions, Thunks, Reducers, and Selectors related to one feature in its own folder together.
I'm also using Redux-Actions for a whole bunch of awesome features. The name-spacing, however, tends to break down with this model for two reasons.
Identity Actions can't get namespaces with this method. I have a lot of actions that either have no payload, or the payload is too simple to require a function transform.
Name-spacing an action requires nesting and produces a nested object as a result. My action files are already split by feature; having the actions nested just requires me to perform boilerplate nesting and destructuring to access the feature.
The part of name-spacing that is extremely useful is the fact that the name-space is included in the toString of the action.
What would be helpful is a feature where I could just provide a blanket prefix that applies to all action names behind the scenes:
Then I could just use these actions like normal, no destructuring required (unless I set that up like with UPDATE) but the existence of the 'MY_FORM' string on the action names, if used correctly, would prevent MY_FORM/VALIDATE from stepping on other features that have a OTHER/VALIDATE.
I could solve this in userland, but it's not pretty.
The text was updated successfully, but these errors were encountered:
I'm using a feature-based model for organizing code. The general idea is that you put Components, Actions, Thunks, Reducers, and Selectors related to one feature in its own folder together.
I'm also using Redux-Actions for a whole bunch of awesome features. The name-spacing, however, tends to break down with this model for two reasons.
The part of name-spacing that is extremely useful is the fact that the name-space is included in the toString of the action.
What would be helpful is a feature where I could just provide a blanket prefix that applies to all action names behind the scenes:
Then I could just use these actions like normal, no destructuring required (unless I set that up like with UPDATE) but the existence of the 'MY_FORM' string on the action names, if used correctly, would prevent MY_FORM/VALIDATE from stepping on other features that have a OTHER/VALIDATE.
I could solve this in userland, but it's not pretty.
The text was updated successfully, but these errors were encountered: