1.0.2 • Published 6 months ago

redux-persist-transform-bigint v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

BigInt Redux Serializer

Transformer to serialize BigInt in Redux Persist. This solves the issue of BigInt not being supported by JSON.stringify and avoids the need to use a custom serializer.

Solves issue #1447 of Redux Persist.

Installation

npm install --save redux-persist-transform-bigint

Usage

import { BigIntTransform } from 'redux-persist-transform-bigint'

const persistConfig = {
  key: 'root',
  storage,
  transforms: [BigIntTransform]
}

// ... rest of the code

or with custom options:

import createBigIntTransform from 'redux-persist-transform-bigint'

const persistConfig = {
  key: 'root',
  storage,
  transforms: [createBigIntTransform({
    whitelist: ['myBigIntReducer']
  })]
}

// ... rest of the code

Options

All the config options that can be passed to the transformer are the same as the ones that can be passed to the redux-persist createTransform function (e.g. whitelist, blacklist).

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago