Reim
Github
2.0.0
2.0.0
  • Reim.js
  • Introduction
    • Motivation
    • Concepts
  • Guide
    • Store
    • setState
    • Subscribe
    • Plugin
    • Event Emitter
    • Use with React / Preact
    • Use with Vue
    • Use with Angular / Rxjs
  • Ecosystem
    • react-reim
    • reim-task
    • reim-reporter
    • reim-persist
    • Release Notes
Powered by GitBook
On this page
  • Exports
  • persist
  1. Ecosystem

reim-persist

import persist from 'react-persist'

reim-persist saves a Reim store's state to localstorage

Exports

persist

persist(options: Object) => func

Usage

const store = reim({}).plugin(persist())

Will get state from localstorage on initialization, and on state change it will write to localstorage.

You can use custom storage by providing storage option:

persist({
    storage: customStorage // your custom storage
})

Note the customStorage must have setItem and removeItem options

Previousreim-reporter

Last updated 6 years ago