alexdovzhanyn/rydux

Change notify_listeners to diff state

Opened this issue · 0 comments

Currently, when notify_listeners is called, we pass the entire new state object to the listener. This is fine, but a good improvement would be to only pass the parts of the state that have changed, because listeners have access to latest state from the store at all times anyway, and will likely only care about new state.

Since any change to the state can have additions or deletions, perhaps this can be best implemented as a diff? The listener would then be passed an object with :additions and :deletions which they can deal with as they choose to.