@runningcodertest/rematch-persist
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • 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

Package Sidebar

Install

npm i @runningcodertest/rematch-persist

Weekly Downloads

0

Version

0.0.4

License

ISC

Unpacked Size

236 kB

Total Files

11

Last publish

Collaborators

  • runningcoder