zhongqf / meteoredux

A small package that make Redux connected with Meteor.
MIT License
16 stars 2 forks source link

Compoments never re-render ? #2

Open yched opened 8 years ago

yched commented 8 years ago

It seems the components using the collection as a prop are never re-rendered when the collection is updated.

The bindReactiveData() callback does run, but the state is never seen as "changed" by Redux's combineReducers() (see the use of 'hasChanged' var in combineReducers, it's always false after the meteoredux reducer). So even though the store does hold the updated content of the collection, the components that depend on it are not re-rendered.

It seems that's because the updateData() function in meteoredux.js modifies the current state in place, instead of copying it ? (the code has a comment about that :-)

zhongqf commented 8 years ago

sorry for late. I will check it when I have time off.