SideEffects<T>.onWaiting constructor

SideEffects<T>.onWaiting(
  1. void onWaiting(), {
  2. void initState()?,
  3. void dispose()?,
})

Side effect to be called while waiting for the state to resolve

Implementation

factory SideEffects.onWaiting(
  void Function() onWaiting, {
  void Function()? initState,
  void Function()? dispose,
}) {
  return SideEffects(
    initState: initState,
    dispose: dispose,
    onSetState: (snap) {
      if (snap.isWaiting) {
        onWaiting();
      }
    },
  );
}