update method

void update(
  1. T updater(
    1. T current
    )
)

Utility functionally updating the value safely.

Implementation

void update(T Function(T current) updater) {
  value = updater(value);
}