DEV Community

Discussion on: Redux in 27 lines

Collapse
 
selbekk profile image
selbekk • Edited

This intro is actually pretty framework agnostic - talking about how Redux is implemented, not how it connects to React.

That being said, the way the connect method from react-redux works is by subscribing on mount, unsubscribing on unmount, and implementing a clever shouldComponentUpdate based on the output of your mapStateToProps method. You could create a similar HOC with this implementation, too!