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

How would this work with ReasonReact.SideEffects #1

Open
damienadermann opened this issue Sep 21, 2017 · 0 comments
Open

How would this work with ReasonReact.SideEffects #1

damienadermann opened this issue Sep 21, 2017 · 0 comments

Comments

@damienadermann
Copy link

Love the tutorial. However I've been looking around for how to handle side effects properly with reducer components and can't find much information. A scenario being if we had a button that loaded the next page. In js react land you might trigger an action that does a side effect that optionally does a state changes along the way.

The flow would be

  1. dispatch action
  2. reducer doesn't do anthing with action (NoUpdate)
  3. Middleware handles the action allowing for more actions to be dispatched and side effects to fetch data or do some other work

Tools that promote this pattern:
-https://github.com/redux-saga/redux-saga
-https://github.com/redux-observable/redux-observable

How would you handle doing a side effect from an event, like the click load more example above?

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