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
Using createActions with sync and async results #206
Labels
Comments
w33ble
changed the title
Using createActions with some async actions
Using createActions with sync and async results
Jan 25, 2015
+1, would be quite useful. |
var createActions = function() {
return Reflux.createActions(_.reduce(arguments, function(h, v) {
return _.isString(v) ? h[v] = {} : _.extend(h, v);
}, {}));
};
var actions = createActions(
'persist',
'get',
'update',
'someAction',
'anotherAction',
{ 'newAsyncAction': { asyncResult: true } }
) |
+1 |
2 similar comments
+1 |
+1 |
This seems to work. Must have been implemented but not closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, the
createActions
method doesn't handle mixing up sync and async actions well. For example, it's very nice when I have all sync actions, like so:However, as soon as I want to add an async action, this has to become an object, a bunch of the values of which are just empty objects themselves.
Ideally, I'd like to be able to do something like this instead:
Again, like I mentioned in #205, maybe I'm just using this wrong - if I am, please let me know the preferred way to set this up
The text was updated successfully, but these errors were encountered: