Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@rematch/persist

1.1.6 • Public • Published

Rematch Persist

Redux-Persist v5 plugin for Rematch.

Provides simple redux state persistence using local storage options.

persist

Install

npm install @rematch/persist

For @rematch/core@0.x use @rematch/persist@0.2.1

Setup

import createRematchPersist from '@rematch/persist'
 
const persistPlugin = createRematchPersist({
  whitelist: ['modelName1'],
  throttle: 5000,
  version: 1,
})
 
init({
  plugins: [persistPlugin]
})

Persist Gate

With React, display a loading indicator while waiting for data to async load from storage.

import { getPersistor } from '@rematch/persist'
import { PersistGate } from 'redux-persist/lib/integration/react'
 
const persistor = getPersistor()
 
const Root = () => {
  <PersistGate persistor={persistor}>
    <App />
  </PersistGate>
}

Config Options

See redux-persist config docs

install

npm i @rematch/persist

Downloadsweekly downloads

6,954

version

1.1.6

license

MIT

homepage

github.com

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability