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

Obscure bug when setting root node to string twice, then to object. #88

Closed psdao1102 closed 7 years ago

psdao1102 commented 8 years ago

When the top most data is a plain string(and perhaps other primatives) setting the root node to an object fails with

TypeError: frozen.reset is not a function

Check out my jsBin: http://jsbin.com/volejo/edit?js,console

arqex commented 7 years ago

Thanks for pointing it out. Freezer's root can only be an object or an array. I'll add it to the docs.