Skip to content
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

Dispatching multiple actions in parallel throws an error #21

Open
Tam opened this issue Jul 24, 2018 · 0 comments
Open

Dispatching multiple actions in parallel throws an error #21

Tam opened this issue Jul 24, 2018 · 0 comments

Comments

@Tam
Copy link

Tam commented Jul 24, 2018

According to the docs, it should be possible to dispatch multiple actions in parallel by passing an array of actions to the store:

// dispatch multiple object in parallel
socrates([
  { type: 'change:name', payload: { name: 'an' }},
  { type: 'change:age', payload: { age: 26 }}
])

But when I attempt this, I get the following redux error:
Error: Actions must be plain objects. Use custom middleware for async actions.


My code:

const slots = { /* a plain object */ }
    , exceptions = { /* a plain object */ };

store([
  { type: "set:slots", payload: slots },
  { type: "set:exceptions", payload: exceptions },
]);

Running each action individually works without issue:

store("set:slots", slots);
store("set:exceptions", exceptions);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant