(track f & args)
Takes a function and optional arguments, and returns a derefable
containing the output of that function. If the function derefs
Reagent atoms (or track, etc), the value will be updated whenever
the atom changes.
In other words, @(track foo bar) will produce the same result
as (foo bar), but foo will only be called again when the atoms it
depends on changes, and will only trigger updates of components when
its result changes.
track is lazy, i.e the function is only evaluated on deref.
Source
(defn
track
"Takes a function and optional arguments, and returns a derefable\n containing the output of that function. If the function derefs\n Reagent atoms (or track, etc), the value will be updated whenever\n the atom changes.\n\n In other words, @(track foo bar) will produce the same result\n as (foo bar), but foo will only be called again when the atoms it\n depends on changes, and will only trigger updates of components when\n its result changes.\n\n track is lazy, i.e the function is only evaluated on deref."
[f & args]
{:pre [(ifn? f)]}
(ratom/make-track f args))