update method

T update(
  1. T newValue
)

Implementation

T update(T newValue) {
  T updated = onUpdate(value, newValue);
  value = newValue;
  return updated;
}