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

Added Single Parent Flag #110

Closed nathanial closed 6 years ago

nathanial commented 6 years ago

This PR attempts to address Issue #103. I've added a singleParent flag to the Freezer constructor that makes the addParent function throw an exception if a node is about to get multiple parents. The default for the flag is false, so no existing code should be effected.

arqex commented 6 years ago

Hi @nathanial

Thanks for the PR, there are going to be many people see this working! I'll try to review the changes and merge it ASAP.