-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Get global state #729
Get global state #729
Conversation
IMO |
Saw it, I think it's doable, |
Not agreed, it is a common design in reactive programming with my knowledge. |
A simple stage, click button pop up a bubble
Your way
I think we need more readable code more than great philosophy. |
Keep acquisition and subscription consistently is basic design principle in reactive programming, not such a great philosophy imo, it can help the right way practice of single source of truth and avoid the abuse of global state. |
I think it is necessary to add a |
I too would prefer a synchronous store access method. something like const test = onGlobalState(state => { return state.test }, true) because at the moment it is looking like function testGet(){
let test: any
onGlobalState(state => { test = state.test }, true)
return test
} |
Let's see my solutions. https://github.com/yuki070/qiankun-redux I use redux to make the global state instead of |
I vote for "getGlobalState" |
closed via we will not recommend global state api at next major version |
@kuitos I think The first time I used |
Checklist
npm test
passesDescription of change
onGlobalStateChange
is not enough.