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

Extending Freezer #22

Closed kuraga closed 9 years ago

kuraga commented 9 years ago

Good day, @arqex ! Thank you for your work!

I want to inherit Freezer in my class (in ECMAScript 6). What do you think about possibility of it?

But Freezer.prototype doesn't have any methods such as get and set. Can this be changed?

arqex commented 9 years ago

Hi @kuraga

I can think of it for the next release. The reason because freezer does not have those methods in the prototype is because it stores the current frozen data using a closure to keep it private.

Maybe we can add it to the Freezer instance as an attribute like _frozen so it is possible to move those methods to the prototype.

Do you want to create a PR for that?

Cheers, Javi

kuraga commented 9 years ago

Yes, I really want. But I'm not sure about my JavaScript competence. But I'll try :smile: What do you exactly propose? Thanks!

Like that? https://github.com/arqex/freezer/compare/master...kuraga:kuraga All tests are green.

Update: I tried my commits to make a class extends Freezer. It works! :smile:

arqex commented 9 years ago

Hi @kuranga

Thanks for your collaboration. I am out of my city without my laptop. I will have a look at your changes on wednesday.

Cheers

kuraga commented 9 years ago

Thanks! All actual info will be in comment above.

rgrwkmn commented 9 years ago

I tried out @kuraga's changes and now I can use babel. I was using jstransform before and had tried moving to babel due to an unrelated bug in jstransform.

arqex commented 9 years ago

Hi, sorry for the delay replying, but I was on holidays and my gf don't let me code! :smile:

I will review those changes, commiting them if they are ok right now.

kuraga commented 9 years ago

Ok, will done later

kuraga commented 9 years ago

See #26