reflux / refluxjs

A simple library for uni-directional dataflow application architecture with React extensions inspired by Flux
BSD 3-Clause "New" or "Revised" License
5.36k stars 330 forks source link

can reflux update store in another store? #464

Closed aoyunfeng closed 7 years ago

aoyunfeng commented 8 years ago

code like global.TestStore1 = Reflux.createStore({ ....... onClicka:function(){ TestStore2.onupdate(value); }, .........

brettjthom commented 8 years ago

I think you should be able to access the variable like any other variable like testStore.variable I have done that from components fine even though it is bad.

Also I think the proper paradigm here is to just make an action and call that.

BryanGrezeszak commented 7 years ago

You would use an action to do this, yes.

And currently that does work. You may call an action from basically anywhere, including a store. A store could easily update another store this way.