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

Bugfix: Preserve pivot when no update is needed #80

Closed oigewan closed 8 years ago

oigewan commented 8 years ago

Bug: If using a pivot to update multiple nested objects and the call to .set() would not result in a change, the node is returned instead of the pivot.

Changes:

  1. Added some stuff to the .gitignore file to prevent my IDE from polluting the repo.
  2. A few minor formatting changes (added semi colons mostly) so that my editor would stop yelling at me.
  3. If no update is needed in the .set() API, check for a pivot. Return it if it's there and return the node if it's not.
  4. Added a unit test for this use case. Test failed due to JS error before change. Succeeds now.
oigewan commented 8 years ago

Looking through the issues, someone else already had this problem. PR fixes #72

arqex commented 8 years ago

Hi @oigewan

Thanks for the PR, it will be merged on the next release. I wanted to publish the next version today but I got stuck with some major changes. I hope it can be released soon.

Cheers

oigewan commented 8 years ago

No worries, man. Glad to see there's still active development. We're pointing to our fork with the patch for now just to allow us to keep moving. I'll check back in a week or two to see about getting back onto the main repo.

This is a great tool. Thanks for the hard work.