redux-persist-transform-encrypt

Encrypt your Redux store

Github stars Tracking Chart

redux-persist-transform-encrypt

npm
Travis

Encrypt your Redux store.

Usage

Synchronous

import { persistReducer } from 'redux-persist'
import createEncryptor from 'redux-persist-transform-encrypt'

const encryptor = createEncryptor({
  secretKey: 'my-super-secret-key',
  onError: function(error) {
    // Handle the error.
  }
})

const reducer = persistReducer(
  {
    transforms: [encryptor]
  },
  baseReducer
)

Asynchronous

Note: Asynchronous support is still a work in progress.

import { persistReducer } from 'redux-persist'
import createAsyncEncryptor from 'redux-persist-transform-encrypt/async'

const asyncEncryptor = createAsyncEncryptor({
  secretKey: 'my-super-secret-key'
})

const reducer = persistReducer(
  {
    transforms: [asyncEncryptor]
  },
  baseReducer
)

Custom Error Handling

The onError property given to the createEncryptor options is an optional
function that receives an Error object as its only parameter. This allows
custom error handling from the parent application.

Main metrics

Overview
Name With Ownermaxdeviant/redux-persist-transform-encrypt
Primary LanguageTypeScript
Program languageJavaScript (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2016-05-14 23:34:19
Pushed At2024-02-02 16:21:28
Last Commit At
Release Count16
Last Release Namev5.1.1 (Posted on )
First Release Namev0.1.0 (Posted on )
用户参与
Stargazers Count363
Watchers Count5
Fork Count63
Commits Count149
Has Issues Enabled
Issues Count50
Issue Open Count0
Pull Requests Count9
Pull Requests Open Count0
Pull Requests Close Count23
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private