component / reactive

Tiny reactive template engine
382 stars 48 forks source link

Question: model.emit('change prop') stable? #141

Closed sunewt closed 10 years ago

sunewt commented 10 years ago

I couldn't help noticing (okay, I actually had to look a bit for it) that the Observe example uses emit('change propname') to make reactive aware of a change when the model is updated directly (as opposed to using the set method). Smalljs refers to it as well (http://smalljs.org/ui/view/reactive/). I'm not able to find anything about this in the docs and it seems a bit reverse engineered. Can this be considered stable, or should I rely on set instead (or make a custom adapter even)?

defunctzombie commented 10 years ago

You should rely on set. The adapter is the other way to do it (and better if you are already using some sort of model layer).