From 4e16484030b4fa759397c53197c54c6118a7584d Mon Sep 17 00:00:00 2001 From: hugocxl Date: Fri, 7 Jun 2024 23:32:40 +0200 Subject: [PATCH] Update React config --- packages/react/src/setup.ts | 16 ++++++++-------- packages/react/src/use-ts.ts | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/react/src/setup.ts b/packages/react/src/setup.ts index a3cd274..52fbc30 100644 --- a/packages/react/src/setup.ts +++ b/packages/react/src/setup.ts @@ -20,24 +20,24 @@ type Config = { defaultLocale: Locale | (() => Locale) loader: Loader format?: GlobalFormat - persistence?: boolean - persistenceKey?: string + persist?: boolean + storageKey?: string } export const config$ = observable() export function setupTerai({ defaultLocale, - persistence = false, - persistenceKey = `terai-${pkg.version}`, + persist = false, + storageKey = `terai-${pkg.version}`, ...options }: Config) { - if (persistence) { + if (persist) { configureObservablePersistence({ pluginLocal: ObservablePersistLocalStorage }) persistObservable(state$, { - local: persistenceKey + local: storageKey }) } @@ -50,8 +50,8 @@ export function setupTerai({ config$.set({ defaultLocale, - persistence, - persistenceKey, + persist, + storageKey, ...options }) } diff --git a/packages/react/src/use-ts.ts b/packages/react/src/use-ts.ts index 2a31953..1349bd6 100644 --- a/packages/react/src/use-ts.ts +++ b/packages/react/src/use-ts.ts @@ -35,7 +35,7 @@ export const useTs = ({ chunkId }: UseTsProps = {}) => { }) } - if (config.persistence) { + if (config.persist) { useEffect(() => { loadDictionary({ locale,