coalesce method

ValueCell<T> coalesce(
  1. ValueCell<T> ifNull
)

Replace null values in this cell with value of another cell.

The value of the returned cell is the value of this cell if it is not null. If the value of this cell is null, the value of the returned cell is the value of the ifNull cell.

Implementation

ValueCell<T> coalesce(ValueCell<T> ifNull) => ComputeCell(
  arguments: {this, ifNull},
  key: _NullCheckCoalesceKey(this, ifNull),
  compute: () => value ?? ifNull.value
).store(changesOnly: true);