tur-nr / polymer-redux

Polymer bindings for Redux.
https://tur-nr.github.io/polymer-redux
MIT License
440 stars 67 forks source link

Use of combineReducers with polymerRedux #72

Closed pedrule closed 7 years ago

pedrule commented 7 years ago

Hi, it seems that the reducers states don't bind with polymer elements when the store is constructed with a combinedReducers. Is anyone have encountered this problem before ?

tur-nr commented 7 years ago

Check what the value of the store's state is and see if it matches your statePath.

tpluscode commented 7 years ago

In other words, when you combine these two

const a = (state, action) => {
  return { stateA: "foo" };
};

const b = (state, action) => {
  return { stateB: "bar" };
};

var combined = combineReducers({
  reducerA: a,
  reducerB: b
});

then you need to prefix the statePath accordingly:

properties: {
  stateOfA: {
    statePath: 'reducerA.stateA'
  },
  stateOfB: {
    statePath: 'reducerB.stateB'
  }
}
pedrule commented 7 years ago

great answer, thanks for time spent to explain.

Pierre

Pierre Alibert

Visites virtuelles Google, kézako ? https://www.youtube.com/watch?v=zJH89F7nOmo

+33 7 77 03 80 92

2017-04-20 3:40 GMT+02:00 Christopher Turner notifications@github.com:

Closed #72 https://github.com/tur-nr/polymer-redux/issues/72.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tur-nr/polymer-redux/issues/72#event-1049689705, or mute the thread https://github.com/notifications/unsubscribe-auth/ALAP4HaWiRFbi4E3AN4Hi5Qt8DI7RzLOks5rxrengaJpZM4M9El1 .