import Spinner from '@/components/elements/Spinner'
import { LazyExoticComponent } from 'react'
import { MutatorOptions } from 'swr'
import { mutate } from 'swr'
import { BareFetcher } from 'swr'
import { Key } from 'swr'
export const lazyLoad = (LazyElement: LazyExoticComponent<() => JSX.Element>) => {
return (
)
}
export const query = async (
key: Key,
fetcher: BareFetcher,
options: MutatorOptions | false = false
): Promise => {
const data = await fetcher(key)
await mutate(key, data, options)
return data
}