Skip to content

Commit

Permalink
fix export
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Apr 23, 2024
1 parent 4056942 commit 3532399
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/persist/index.rn.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { getPersistStore, debounce } from './get-persist';
import RNCache from './rn-cache';
import { createPersist as createStatePersist } from './create-persist';
import { Provider } from './provider';

export * from './provider';

export const isClient = true;
const { wrapState, persistStore } = getPersistStore(RNCache, isClient);
export { debounce, wrapState, persistStore, Provider };
export { debounce, wrapState, persistStore };

export const usePersist = createStatePersist({ cache: RNCache, debounce: 100 });
5 changes: 3 additions & 2 deletions src/persist/index.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Options } from './create-persist';
import { getPersistStore, debounce } from './get-persist';
import { Provider } from './provider';

export * from './provider';

export const isClient = typeof document !== 'undefined';
const obj: any = {};
Expand All @@ -16,5 +17,5 @@ const cacheStore = {
},
};
const { wrapState, persistStore } = getPersistStore(cacheStore, isClient);
export { debounce, wrapState, persistStore, Provider };
export { debounce, wrapState, persistStore };
export const usePersist = (_options: Options<any>) => [() => null, true];
5 changes: 3 additions & 2 deletions src/persist/index.web.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { getPersistStore, debounce } from './get-persist';
import { createPersist as createStatePersist } from './create-persist';
import webCache from './web-cache';
import { Provider } from './provider';

export * from './provider';

export const isClient = typeof document !== 'undefined';

const { wrapState, persistStore } = getPersistStore(webCache, isClient);
export { debounce, wrapState, persistStore, Provider };
export { debounce, wrapState, persistStore };

export const usePersist = createStatePersist({
cache: webCache,
Expand Down

0 comments on commit 3532399

Please sign in to comment.