2.0.1 • Published 4 years ago

@tandem.ly/redux-persist-transform-encrypt v2.0.1

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

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'
});

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
);