Closed PFight closed 6 years ago
There is a section in readme
It is always necessary to call .get on derivables to find out what's inside, and you always have to call .set on atoms to change what's inside. This provides a consistent semantic and visual distinction between ordinary values and derivable values.
I understand, but I think, .value is not so transparent. It is explicit enough to distinguish atom from ordinary value. Just more convinient syntax:
$atom.set($atom.get() + 1) $atom.value = $atom.value + 1; // Much nicier
I wouldn't said it's much nicer since you are introduce some implicit magic via setter and getter. Also there is already an API for that. Introducing another one adds inconsistency in a team and as a result complexity. API should have only one way to do one thing.
I license my contributions to the DerivableJS project under the Apache License 2.0.