import useSWR , { Middleware } from 'swr' ; import { withMiddleware } from '../src/utils/with-middleware' ; export const immutable = useSWRNext => ( key , fetcher , config ) => { config . revalidateOnFocus = false ; config . revalidateIfStale = false ; config . revalidateOnReconnect = false ; return useSWRNext ( key , fetcher , config ) ; } ; export default withMiddleware ( useSWR , immutable ) ;