# extendify/3.0.6/src/Launch/hooks/useFetch.js

Extendify, version 3.0.6. 17 lines.

- Page: https://pluginprobe.com/plugins/extendify/3.0.6/code/src/Launch/hooks/useFetch.js
- Raw: https://pluginprobe.com/plugins/extendify/3.0.6/raw/src/Launch/hooks/useFetch.js
- Modified: 2024-10-08T10:19:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/extendify/3.0.6/code/src/Launch/hooks/useFetch.js#L10-L20`.

```javascript
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,
	};
};

```
