- In the component we import the state and the event handlers.
- We can map state to props pretty simply by using the connectToState higher order component, which just gets the latest value from the different parts of the state and passes them as props to the wrapped component on render.
- We can get their latest value directly (which becomes important in the component), and we can hook them up to events with a next and error handlers, and return a new value for that child.
- We also get “should component update” for free, since the component will only re-render if a distinct value comes down the pipe.
- Also notice that we don’t need to bind our event handlers, or have a provider anywhere.
Read the full article, click here.
@ReactiveConf: “Functional state management for #ReactJS using #RxJS:”
I’ve been developing React applications with Redux for a while now, and for about as long I’ve been thinking "I bet there is a simpler way to do this .
Functional State Management for React using RxJS