Yarikx / reductor

Redux for Android. Predictable state container library for Java/Android
Apache License 2.0
463 stars 27 forks source link

About the Appstate Subscribe improments #34

Open ManBali opened 7 years ago

ManBali commented 7 years ago

hi,first for you reductor share. we can subscribe the datas changes we can get notifiy. counterStore.subscribe(state -> System.out.println(state));

ok,it seems perfect,but when this happen .

there are Activity Named A,Activity Named B.

we start the A-->B

and we subscribe state in both A,B , at the same time ,A cares the datas field in state is a_name,a_sex and so on.

but B cares the datas field in state is b_name,b_sex, and so on.

when B send a dispatch action to change the b_name ,b_sex datas,

How Ever A had received the state callback the same ,i think this not very well .

in react -redux ,we use connect to diff the datas .

SO,the question is did't you had good methods to solve this problems?

andy-pro commented 6 years ago

Is it possible to subscribe to changes in different parts of the AppState?

new-xd commented 6 years ago

You can use Cursors.map method to subscribe the data you want