update method

bool update(
  1. bool cb(
    1. bool state
    )
)

Implementation

bool update(bool Function(bool state) cb) => state = cb(state);