select<T> method
Create a new cell which selects between the values of two cells based on this
.
If this
is true, the cell evaluates to the value of ifTrue
.
If this
is false, the cell evaluates to the value of ifFalse
if it is
a cell. Otherwise if ifFalse
is null, the cell's value is not updated.
Implementation
ValueCell<T> select<T>(ValueCell<T> ifTrue, [ValueCell<T>? ifFalse]) => ifFalse != null
? ValueCell.computed(() => this() ? ifTrue() : ifFalse())
: ValueCell.computed(() => this() ? ifTrue() : ValueCell.none());