statex
statex copied to clipboard
Is there a Redux middleware alike mechanism?
I want to do this. https://stackoverflow.com/questions/37221872/storing-global-object-outside-of-redux-store-in-react-redux-app
StateX maintains it's own state. However you can subscribe to state changes and update state based on your own global state using the following.
import { State } from 'statex'
import Immutable from 'statex/dist/core/immutable'
// subscribe to state changes
State.subscribe((state) => console.log('changed state', state))
// update state
State.next(Immutable.from(newState))