arqex / freezer

A tree data structure that emits events on updates, even if the modification is triggered by one of the leaves, making it easier to think in a reactive way.
MIT License
1.28k stars 56 forks source link

listeners notified out of order when using #pivot #51

Closed christianvogt closed 8 years ago

christianvogt commented 8 years ago

Related to issue #48

The new pivot functionality affects the order in which listeners are notified. I've created a new jsbin which shows the listeners being notified out of order.

More importantly though listeners on specific nodes are not notified until the next tick which breaks part of the benefits of using live mode or now where listeners should be notified immediately

http://jsbin.com/miyemodimu/edit?html,js,console

arqex commented 8 years ago

Sorry for the delayed reply. And thanks again for your feedback.

It is really tricky this issue. I am studing it now and have a solution but it is far from elegant.

When using pivot the parent node is returned so now is called on the parent, that's why all the mess is happening.

I will inform you on new progress.

arqex commented 8 years ago

Ey @zenfe

There were 2 bugs affecting this issue. Now fixed in v0.8.0. See how your jsbin is working ok now.

Cheers, Javi