reapex-plugin-local-storage
v1.1.1
Published
Persist application state to localStorage
Downloads
6
Readme
Reapex local storage plugin
Easily persist and restore data between state and local storage
import { App } from 'reapex'
import createLocalStoragePlugin from 'reapex-plugin-local-storage'
// 1. Initialize the plugin
const { plugin, persist } = createLocalStoragePlugin()
const app = new App()
// 2. register the plugin
app.plugin(plugin)
// 3. Simply wrap a `model` with `persist`
const UserModel = app.model('User', { name: '', age: 0 })
persist(UserModel)