Closed dashed closed 9 years ago
Yeah, but I think that as you listen to change on ['foo', 'value'] and with the first change on foo it should trigger the listener twice. as a change on foo (as a parent of value) is essentially a change in value as well.
Ah didn't see that comment. I added my arguments https://github.com/omniscientjs/immstruct/commit/e1d2488c3d0791fc212494beffcf3601b67d8443#commitcomment-11868738
Thinking about this in terms of for instance "sub render-loops" in React, I think you are right. Say I have a component that listens to ['foo', 'value']
and value
is unchanged, I wouldn't expect to get triggered. The output is still the same (undefined
). Good catch, @Dashed
when traversing a non-immutable collection by key, set it as
void 0
.