onMiddleCRUD method

void onMiddleCRUD(
  1. SnapState snap
)

Implementation

void onMiddleCRUD(SnapState<dynamic> snap) {
  if (_onCrudRM != null && _onCrudRM!.snapValue != snap) {
    _onCrudRM!.snapValue = snap;
    _onCrudRM!.notify();
  }
  if (snap.isWaiting) {
    _isOnCRUD = true;
    onCRUDSideEffects?.onWaiting?.call();
  } else if (snap.hasError) {
    _isOnCRUD = false;
    onCRUDSideEffects?.onError
        ?.call(snap.snapError!.error, snap.snapError!.refresher);
  } else if (snap.hasData) {
    _isOnCRUD = false;
    onCRUDSideEffects?.onResult(snap.data);
  }
}