Hao

Interesting Redux/React Repos

There are some interesting Redux/React related repos worthy to dive into.

react-tunnel

React components and decorators for putting context-like values into context and pulling them out as props

React-virtualized
Redux-Component

A isolated redux store is created for each React component instance. It has nothing to do with your global flux architecture.

There are four parts:

  1. to create the store with component’s reducer
  2. to use that store.dispatch to configure its actions, mapDispatchToActions
  3. to use store.subscribe to make sure that every acton fired would trigger the component’s setState(store.getState())
  4. there are a few housekeeping thinking, like subscribe/unsubscribe with the store and exposing React lifecyle APIs
multireducer

A utility to wrap many copies of a single Redux reducer into a single key-based reducer.

Since the actions in Redux is differentiated by action.type, if we want to re-use the action and reducer of a specific (redux) component we need to hijack the action.type by tagging along a String Constant (like WRAPPEDBY=) before it is dispatched. Meanwhile, we need the logic to help the related reducer to decipher the hijacked action.

In this way,

  1. Same (redux) components can be reused
  2. State changes can be confidently put on the Global State tree under a specific namespace
redux-ui
realm

One way to think of it is as “nested Redux.” Each Realm component is its own mini-Redux app, which can be composed of other Redux apps.

Posted March 17, 2016
READ THIS NEXT:

Optimizing Infinite Scroll List


blog comments powered byDisqus