Comments (6)
I would like to propose an alternative
What user provides is this array of states, actions and transitions:
['initialize', 'idle',
['fetch', 'fetching',
['cancel', 'idle'],
['report error', 'error',
['handle error', 'idle']
],
['report success', 'success',
['handle success', 'idle']
]
]
]
];
and I like how the actionCreators
maps state transitions to methods.
If I understand correctly what you are proposing David is to have the same structure in actions
so calling actions.handleSuccess
would return string value.
How about combining those two and instead of having both actionCreators
and actions
do something like this:
handleSuccess: {
creator: () => {},
name: "NAME"
},
...
}
On the other hand, I don't like adding another level of nesting and it seems reasonable to just import { handleSuccess, handleError} from './myActionCreators'
and then simply call it without accessing nested creator
. With this in mind I'm leaning toward David's idea which doesn't include additional nesting but I'm posting above as the food for thought.
from redux-dsm.
Merged. Will look at releasing the change with a major version bump soon.
from redux-dsm.
You mean we should expose action type constants as an object with original labels as keys? That's not a bad idea. PR?
from redux-dsm.
from redux-dsm.
Awesome thanks :-)
from redux-dsm.
Published as 2.0.0
from redux-dsm.
Related Issues (12)
- Create middleware to assure actions dispatched in right order HOT 1
- Initial status is ignored.. 'idle' is always used. HOT 1
- Should provide selector
- Export statuses
- Can't use the same action type in more than one graph state
- Add snyk
- Fix imports HOT 5
- Restrict state transitions according to graph HOT 7
- Dependency Dashboard
- Remove Babel dependencies. HOT 10
- Port to ES5? HOT 22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-dsm.