update<T> method

void update<T>(
  1. Creator<T> creator,
  2. T update(
    1. T
    )
)

Set state of creator using an update function. See set. No-op if the state doesn't change.

Implementation

void update<T>(Creator<T> creator, T Function(T) update) {
  set<T>(creator, update(_element(creator).state));
}