Skip to content

Commit

Permalink
fix: increment package version for moon-react to 2.0.27; add useDeban…
Browse files Browse the repository at this point in the history
…kUserTokensQuery hook and refactor GlobalProvider for QueryClient integration
  • Loading branch information
ewhal committed Dec 20, 2024
1 parent 7ae488c commit 02641fa
Show file tree
Hide file tree
Showing 4 changed files with 477 additions and 452 deletions.
2 changes: 1 addition & 1 deletion packages/moon-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonup/moon-react",
"version": "2.0.26",
"version": "2.0.27",
"license": "MIT",
"author": "0xEwhal <[email protected]>",
"type": "module",
Expand Down
19 changes: 12 additions & 7 deletions packages/moon-react/src/context/GlobalProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { MoonSDKConfig } from "@moonup/moon-sdk";
import { QueryCache, QueryClient } from "@tanstack/react-query";
import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";
import {
QueryCache,
QueryClient,
QueryClientProvider,
} from "@tanstack/react-query";
import { persistQueryClient } from "@tanstack/react-query-persist-client";
import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";

import type { ReactNode } from "react";
Expand Down Expand Up @@ -53,12 +57,13 @@ export const GlobalStateProvider: React.FC<GlobalStateProviderProps> = ({
reconnect(config as Config);
});
}, []);
persistQueryClient({
queryClient,
persister: persister,
});

return (
<PersistQueryClientProvider
client={queryClient}
persistOptions={{ persister }}
>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<MoonAuthProvider sdkConfig={sdkConfig}>
<WagmiProvider config={config}>
Expand All @@ -68,6 +73,6 @@ export const GlobalStateProvider: React.FC<GlobalStateProviderProps> = ({
</WagmiProvider>
</MoonAuthProvider>
</ThemeProvider>
</PersistQueryClientProvider>
</QueryClientProvider>
);
};
Loading

0 comments on commit 02641fa

Please sign in to comment.