From 25f641ff86a2bda464a8f7750fbddea7056322d8 Mon Sep 17 00:00:00 2001 From: Violet Caulfield Date: Fri, 14 Feb 2025 05:27:10 -0600 Subject: [PATCH] query client persistence? --- constants/storage.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/constants/storage.ts b/constants/storage.ts index 43aa7dc9..66dfddf9 100644 --- a/constants/storage.ts +++ b/constants/storage.ts @@ -1,5 +1,7 @@ import { MMKV } from "react-native-mmkv"; import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister"; +import { persistQueryClient } from "@tanstack/react-query-persist-client"; +import { queryClient } from "./query-client"; export const storage = new MMKV(); @@ -16,4 +18,9 @@ const clientStorage = { }, }; - export const clientPersister = createSyncStoragePersister({ storage: clientStorage }); \ No newline at end of file + export const clientPersister = createSyncStoragePersister({ storage: clientStorage }); + + persistQueryClient({ + queryClient, + persister: clientPersister + }); \ No newline at end of file