react-native 端的持久化引擎,基于 react-native-mmkv
# 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: [],
},
],
});