File "useFetch.js"
Full Path: /home/safaelji/recrut.automotomaroc.com/wp-content/plugins/extendify/src/Launch/hooks/useFetch.js
File size: 342 bytes
MIME-type: text/x-java
Charset: utf-8
import useSWR from 'swr';
export const useFetch = (params, fetcher, options = {}) => {
const { data, error } = useSWR(params, (key) => fetcher(key), {
revalidateIfStale: false,
revalidateOnFocus: false,
revalidateOnReconnect: false,
...options,
});
return {
data,
loading: !data && !error && !error?.message,
error,
};
};