lockRelease static method

void lockRelease(
  1. dynamic state,
  2. String name, {
  3. required Function perform,
  4. bool shouldSetState = true,
  5. void onError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
})

Perform a lock release The lockRelease method will call the function provided in perform and then block the function from being called again until it has finished. An Exception from perform goes to onError (see NyBaseState.lockRelease).

Implementation

static void lockRelease(
  dynamic state,
  String name, {
  required Function perform,
  bool shouldSetState = true,
  void Function(Object error, StackTrace stackTrace)? onError,
}) {
  _updateState(_findStateName(state), "lock-release", {
    "name": name,
    "perform": perform,
    "shouldSetState": shouldSetState,
    "onError": onError,
  });
}