Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-persist-transform-filter-immutable

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-persist-transform-filter-immutable

Filter transformator for redux-persist supporting immutable.js

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.7K
decreased by-13.72%
Maintainers
1
Weekly downloads
 
Created
Source

redux-persist-transform-filter-immutable

Filter transformator for redux-persist supporting immutable.js

Installation

  npm install redux-persist-transform-filter-immutable

Usage

import createFilter from 'redux-persist-transform-filter-immutable';

// you want to store only a subset of your state of reducer one
const saveSubsetFilter = createFilter(
  'myReducerOne',
  ['keyYouWantToSave1', 'keyYouWantToSave2']
);

// you want to load only a subset of your state of reducer two
const loadSubsetFilter = createFilter(
  'myReducerTwo',
  null,
  ['keyYouWantToLoad1', 'keyYouWantToLoad2']
);

// saving a subset and loading a different subset is possible
// but doesn't make much sense because you'd load an empty state
const saveAndloadSubsetFilter = createFilter(
  'myReducerThree',
  ['one', 'two']
  ['three', 'four']
);

// deeply nested values can be used via arrays as path
const nestedSubsetFilter = createFilter(
  'myReducerThree',
  [['my', 'path'], ['my', 'other', 'path']],
  [['my', 'path'], ['my', 'other', 'path']]
);

persistStore(store, {
  transforms: [
    saveSubsetFilter,
    loadSubsetFilter,
    saveAndloadSubsetFilter,
  ]
});

Thanks

Thanks to Eduard Baun for redux-persist-transform-filter - on which this implementation is based.

Keywords

FAQs

Package last updated on 08 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc