@connected-home/redux-persist-transform-encrypt
Encrypt your Redux store.
Last updated 2 years ago by beavis07 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @connected-home/redux-persist-transform-encrypt 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 3.1.1                                ...           latest (2 years ago)

3 Versions

  • 3.1.1                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 2
Last Month 1
Dependencies (3)
Dev Dependencies (10)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |