diff --git a/src/lib/swr.ts b/src/lib/swr.ts index a54cd63..caa6bb9 100644 --- a/src/lib/swr.ts +++ b/src/lib/swr.ts @@ -38,12 +38,10 @@ const defaultSWRStore = { }; const defaultSWRParams = { - options: { - enabled: true, - initialData: undefined, - // revalidateOnFocus: true, - // revalidateOnReconnect: true, - }, + enabled: true, + initialData: undefined, + // revalidateOnFocus: true, + // revalidateOnReconnect: true, }; export function useSWR(): SWRStore { @@ -64,14 +62,8 @@ export function useSWR(): SWRStore { }); function update(params: SWRParams) { - params = { - ...defaultSWRParams, - ...params, - options: { - ...defaultSWRParams.options, - ...params.options, - }, - }; + params.options = { ...defaultSWRParams, ...params.options }; + fsm.send("revalidate", params); }