Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 1.02 KB

README.md

File metadata and controls

53 lines (43 loc) · 1.02 KB

foca-electron-storage

electron 端的持久化引擎。

License npm

安装

# npm
npm install foca-electron-storage
# yarn
yarn add foca-electron-storage
# pnpm
pnpm add foca-electron-storage

使用

import { store } from 'foca';
+import { electronStorage } from 'foca-electron-storage';

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

也可以定制参数

import { store } from 'foca';
+import { createElectronStorage } from 'foca-electron-storage';

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