redux-persist-transform-bigint
v1.0.2
Published
Transformer to serialize BigInt in Redux Persist
Downloads
21
Readme
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).