import 'package:rasadyar_core/core.dart';

Future<void> safeCall<T>({
  required AppAsyncCallback<T> call,
  Function(T result)? onSuccess,
  ErrorCallback? onError,
  VoidCallback? onComplete,
  bool showLoading = false,
  bool showError = false,
  bool showSuccess = false,
  bool showToast = false,
  bool showSnackBar = false,
  Function()? onShowLoading,
  Function()? onHideLoading,
  Function()? onShowSuccessMessage,
  Function()? onShowErrorMessage,
}) {
  return gSafeCall(
    call: call,
    onSuccess: onSuccess,
    onError: onError,
    onComplete: onComplete,
    showLoading: showLoading,
    showError: showError,
    showSuccess: showSuccess,
    showToast: showToast,
    showSnackBar: showSnackBar,
    onShowLoading: onShowLoading,
    onHideLoading: onHideLoading,
    onShowSuccessMessage: onShowSuccessMessage,
    onShowErrorMessage: onShowErrorMessage,
  );
}

