Changelog
0.9.2
This library was using Ramda.js' equality function which does deep equality checking on ordinary javascript objects. That's all fine, except not when it sometimes throws up false positives! The newest version fixed that, but I don't feel comfortable using Ramda's stuff anymore.
Luckily, most of the time identity checks are all we need, and they're lovely and fast.
People can, of course, still inject their own equality junk if they need extra protection against redundant computation.
Changelog
0.9.1
New Stuff:
adopt
method for allowing reactors to become dependent without needing to be
started in a reaction cycle. Should have been in 0.8.0.Changelog
0.9.0
BREAKING CHANGES:
some
function renamed to mIfThenElse
Derivable#some
method renamed to mThen
I know this is uglier, but is ultimately consistent with the following:
New Stuff:
Derivable#mDerive
for nil-shortcutting derivations, e.g.
atom(null).mDerive(x => x.toString()).get()
simply returns null
, doesn't
throw an error. Think of it like the elvis operator in c#.
Derivable#mOr
for nil-only 'or' semantics e.g.
atom(false).mOr(5) === false
while atom(false).or(5) === 5
Derivable#mAnd
for nil-only 'and' semantics e.g.
atom('').mAnd(5) === 5
while atom('').and(5) === ''
top level functions mDerive
, mOr
and mAnd
for the above.
top level function lookup
for performing ordinary javascript property lookup
on derivables.
top level function destruct
for destructuring derivables. <3 this function.
Changelog
0.8.0
BREAKING CHANGES:
Other Changes
Reactors can now 'depend' on other reactors. That is, if Reactor A starts Reactor B (via the Reactor#start method), B is said to be dependent on A. If A is stopped, B will be also be stopped (but if A is started, B is not also started). More importantly, if A and B need to react to the same change, A is guaranteed to react before B. This lets reactors control each other's lifecycles without fear of race conditions.
Reactors now have a method Reactor#orphan which removes any dependency the reactor has.
A minor bug involving creating reactors within transactions was fixed.
Changelog
0.7.1
Fix bug where parents were being traversed in the wrong order during reaction phases. This precluded true laziness in some cases.