apply<U> method

ValueCell<U> apply<U>(
  1. U fn(
    1. T value
    ), {
  2. dynamic key,
})

Create a new cell, with a value which is computed by applying a function on this cell's value

The value of the returned cell is the return value of fn, a function of one argument, when applied on the this cell's value.

The created cell is identified by key if non-null.

Implementation

ValueCell<U> apply<U>(U Function(T value) fn, {
  key,
}) => ComputeCell(
    compute: () => fn(value),
    arguments: {this},
    key: key
);