first property

MutableCell<T> get first

Returns a cell which evaluates to List.first applied on the value in this cell.

Changing the value of the returned cell updates the value of the first element of the List held in this cell.

NOTE: The actual list is not modified but a new list is created.

Implementation

MutableCell<T> get first => mutableApply((value) => value.first,
    (v) => value = _updatedList(value, 0, v),
    key: _MutableListPropKey(this, #first),
    changesOnly: true
);