rikukissa
8/26/2017 - 2:03 PM

Creating isolated Redux widgets

Creating isolated Redux widgets

Creating isolated Redux widgets

https://github.com/rikukissa/redux-isolated-apps

Sub apps

http://redux.js.org/docs/recipes/IsolatingSubapps.html

Pros:

  • Minimalistic approach, easy to understand
  • Minimal code changes required when isolating pieces of UI
  • Easy integration with redux-loop, redux-forms etc

Cons:

  • No way of calling global actions
    • Solutions:
      • Adding callback props to widget
        • Cons:
          • Transforming reducer events into callback prop calls get hairy

Reducer namespaces

Cons:

  • A lot of boilerplate code
  • Long action names clutter Redux DevTools

redux-subspace 🏆

https://github.com/ioof-holdings/redux-subspace

Pros:

  • No drawbacks in isolating a component so far

Cons:

  • Not sure whether this works with redux-loop

Recompose's withReducer