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