statex icon indicating copy to clipboard operation
statex copied to clipboard

Is there a Redux middleware alike mechanism?

Open changtimwu opened this issue 7 years ago • 1 comments

I want to do this. https://stackoverflow.com/questions/37221872/storing-global-object-outside-of-redux-store-in-react-redux-app

changtimwu avatar Feb 28 '18 11:02 changtimwu

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))

rintoj avatar Mar 12 '18 11:03 rintoj