lockRelease method

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

Run perform and block it from running again until it has finished. An Exception from perform goes to onError (see NyBaseState.lockRelease).

Implementation

void lockRelease(
  String name, {
  required Function perform,
  bool shouldSetState = true,
  void Function(Object error, StackTrace stackTrace)? onError,
}) {
  StateAction.lockRelease(
    state,
    name,
    perform: perform,
    shouldSetState: shouldSetState,
    onError: onError,
  );
}