update method

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

Updates the value using a function.

Implementation

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