Returns true, if the view's value has changed since last {@link @thi.ng/api#IDeref.deref}.
Returns view's value. If the view has a transformer, the transformed value is returned. The transformer is only run once per value change.
Disconnects this view from parent state, marks itself dirty/changed and sets its unprocessed raw value to undefined
.
Like {@link @thi.ng/api#IDeref.deref}, but doesn't update view's cached state and dirty flag if value has changed.
Generated using TypeDoc
This class implements readonly access to a deeply nested value with in an Atom/Cursor. An optional transformer function can be supplied at creation time to produce a derived/materialized view of the actual value held in the atom.
Views can be created directly or via the {@link IViewable.addView} method of the parent state. Views can be {@link @thi.ng/api#IDeref.deref}'d like atoms and polled for value changes using IView.changed. The transformer is only applied once per value change and its result cached until the next change.
If the optional
lazy
is true (default), the transformer will only be executed with the first {@link @thi.ng/api#IDeref.deref} after each value change. Iflazy
is false, the transformer function will be executed immediately after a value change occurred and so can be used like a watch which only triggers if there was an actual value change (in contrast to normal watches, which execute with each update, regardless of value change).Related, the actual value change predicate can be customized. If not given, the default equiv will be used.