Riddl - lightweight state management


(Ben Turner) #1

I’ve been using react/redux/thunk for the past year and I realized how much I hated writing all the boilerplate necessary just to get a simple app working.

With the new Context API available I figured I’d try my hand at writing a React-specific state management library that follows the same patterns as redux but in a more intuitive way with far less boilerplate.

It is called riddl-js and employs the new Context API. I would love to get some feedback from anyone interested in using it. It is intended to allow you to interact with global state in the same exact way as you would change any local state, without the going through the steep learning curve of redux/mobx, etc.

The principle behind it is simple: A <Provider> component maintains the global state, and renders a Context.Provider, passing it its current state. A connect function is the ambassador for the state and passes information via props (similar to redux). Functions called transmitters can be used to deal with asynchrony.

Thanks!