Skip to content

react-native 端的持久化引擎,基于react-native-mmkv

License

Notifications You must be signed in to change notification settings

foca-js/foca-mmkv-storage

Repository files navigation

foca-mmkv-storage

react-native 端的持久化引擎,基于 react-native-mmkv

License npm

安装

# pnpm
pnpm add foca-mmkv-storage
cd ios && pod install

使用

import { store } from 'foca';
+import { mmkvStorage } from 'foca-mmkv-storage';

store.init({
  persist: [
    {
      key: 'my-project',
      version: '1',
+     engine: mmkvStorage,
      models: [],
    },
  ],
});

也可以定制参数

import { store } from 'foca';
+import { createMmkvStorage } from 'foca-mmkv-storage';

store.init({
  persist: [
    {
      key: 'my-project',
      version: '1',
+     engine: createMmkvStorage({...}),
      models: [],
    },
  ],
});