Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a Redux middleware alike mechanism? #16

Open
changtimwu opened this issue Feb 28, 2018 · 1 comment
Open

Is there a Redux middleware alike mechanism? #16

changtimwu opened this issue Feb 28, 2018 · 1 comment

Comments

@changtimwu
Copy link

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

@rintoj
Copy link
Owner

rintoj commented Mar 12, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants