javascript - Flux: Actions in sub components -


i have identical components, might in store:

{   user: {id: 123, name: 'joe'}   modules: [     { alotof: 'data', ... },     { alotof: 'data', ... },     ...   ] } 

because don't want components know each other or position data stored in array thinking of providing them sub store "all-wise" container component (in ngrx/store it's possible "select" guess):

{   user: {id: 123, name: 'joe'},   data: { alotof: 'data', ... } } 

so each component had own sub store needed data , still there complete app state.

but now, when 1 of these components fires event "change headline", how should reducer know position in array has change?

i thinking of passing unique id sub components , using these payload don't that.

so how can have sub components, don't know each other , still can fire general actions?


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -