import 'package:rasadyar_core/core.dart';

Future<T?> 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,
}) {
  return gSafeCall<T>(
    call: call,
    onSuccess: onSuccess,
    onError: onError,
    onComplete: onComplete,
    showLoading: showLoading,
    showError: showError,
    showSuccess: showSuccess,
    onShowLoading: onShowLoading,
    onHideLoading: onHideLoading,
  );
}