Skip to content

Commit

Permalink
preserve swr mutate
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed Apr 6, 2023
1 parent 64b4387 commit 379d2e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/proxy/use-widget-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function useWidgetAPI(widget, ...options) {
if (options && options[1]?.refreshInterval) {
config.refreshInterval = options[1].refreshInterval;
}
const { data, error } = useSWR(formatProxyUrl(widget, ...options), config);
const { data, error, mutate } = useSWR(formatProxyUrl(widget, ...options), config);
// make the data error the top-level error
return { data, error: data?.error ?? error }
return { data, error: data?.error ?? error, mutate }
}

0 comments on commit 379d2e5

Please sign in to comment.