package.immutable.dist.index.mjs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swr Show documentation
Show all versions of swr Show documentation
React Hooks library for remote data fetching
import useSWR from 'swr';
import { withMiddleware } from 'swr/_internal';
const immutable = (useSWRNext)=>(key, fetcher, config)=>{
// Always override all revalidate options.
config.revalidateOnFocus = false;
config.revalidateIfStale = false;
config.revalidateOnReconnect = false;
return useSWRNext(key, fetcher, config);
};
var index = withMiddleware(useSWR, immutable);
export { index as default, immutable };