Hacker News new | ask | show | jobs
by djfm 3743 days ago
> At least until you want asynchronous actions (and you will) in which case it seems to shrug and encourage using addons with side effects.

Imho there's nothing special with async actions and you don't necessarily need an addon, they're just actions arriving to the reducer later, and it can't see the difference. Your data fetching is no more async than a user clicking on a button.

1 comments

Well, rather than getting into a debate on what constitutes "nothing special" or "side effect", I'll let the docs explain the details.

http://redux.js.org/docs/advanced/AsyncActions.html

Note however that it does say "This function doesn’t need to be pure; it is thus allowed to have side effects, including executing asynchronous API calls."

Out of curiosity, would it be possible to be able to do async actions without side effects?
setTimeout() ?
Creating a timeout modifies the global state and is therefore a side effect.