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