From a53ce56911bd3840f7b1761cae6dab45a3dc1659 Mon Sep 17 00:00:00 2001 From: Fedir Ushakov Date: Mon, 6 Jun 2022 08:59:57 +0300 Subject: [PATCH] fix(persist): introduce in-house synchronous Storage interface --- src/createWebStoragePersister/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/createWebStoragePersister/index.ts b/src/createWebStoragePersister/index.ts index d8835abad0..7b0e21fea4 100644 --- a/src/createWebStoragePersister/index.ts +++ b/src/createWebStoragePersister/index.ts @@ -5,6 +5,12 @@ import { PersistRetryer, } from '../persistQueryClient' +interface Storage { + getItem: (key: string) => string | null + setItem: (key: string, value: string) => void + removeItem: (key: string) => void +} + interface CreateWebStoragePersisterOptions { /** The storage client used for setting and retrieving items from cache. * For SSR pass in `undefined`.