import { useState, useCallback } from 'react';
import { cancelPendingRequest } from 'react-native-cloud-ca';
const useCancelPendingRequest = () => {
  const [result, setResult] = useState(null);
  const [error, setError] = useState(null);
  const [isLoading, setIsLoading] = useState(false);
  const cancelPendingRequestFunc = useCallback(async params => {
    const {
      transactionID,
      request,
      hashAlgorithm
    } = params;
    try {
      setIsLoading(true);
      const response = await cancelPendingRequest({
        transactionID,
        request,
        hashAlgorithm
      });
      setResult(response);
    } catch (e) {
      setError(e);
    } finally {
      setIsLoading(false);
    }
  }, []);
  return [result, error, cancelPendingRequestFunc, isLoading];
};
export default useCancelPendingRequest;
//# sourceMappingURL=useCancelPendingRequest.js.map