0.0.9 • Published 4 years ago

persist-check-version-transform v0.0.9

Weekly downloads
131
License
-
Repository
github
Last release
4 years ago

Redux-persist check version transform

Redux persist with version information.

Install

yarn add https://github.com/devx-agency/redux-persist-check-version-transform

Usage

const persistWhitelist = ['userData', 'product']
const reduxStore = {
  userData: {
    redux: require('../Redux/UserDataRedux'),
    blacklist: ['username'],
    encrypt: true,
    version: 1
  },
  product: {
    redux: require('../Redux/ProductRedux'),
    whitelist: ['productName'],
    version: 1
  }
}
const pass = 'pass'
const persistConfig = { // 'redux-persist' config
  key: 'devx',
  storage: localForage,
  transforms: [immutableTransform(), persistCheckVersionTransform(reduxStore, persistWhitelist, pass)],
  whitelist: persistWhitelist
}

Configuration

VariableTypeDescription
persistWhitelistArraywhich redux will be stored
reduxStore{key: string: Options}configuration of persist tranform
passstringpassword for encrypted data

Options

VariableTypeDescription
reduximported redux
blacklistArrayvariables will not be persisted
whitelistArrayonly this variables will be persisted
encryptbooleandefault false if data should be persisted
versionnumberdata version

When version is incresed, old data will be deleted.

State reconciler

import { stateReconcilerImmutable } from 'persist-check-version-transform'

Thanks to V&T

0.0.9

4 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago