Socket
Book a DemoInstallSign in
Socket

local-redux-storage

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

local-redux-storage

Simple, small and dependency free redux state to local storage on reduce layer.

latest
Source
npmnpm
Version
1.0.9
Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

Local Redux Storage

NPM version Dependency Status devDependency Status

NPM

Simple, small and dependency free redux state to local storage on reduce layer.

Installation

npm i local-redux-storage

Usage

For all state.

import { createStore, combineReducers } from 'redux';
import storage from 'local-redux-storage';

const rootReducer = combineReducers({ ...reducers })

const store = createStore(storage(rootReducer))

For one reducer state.

import { createStore, combineReducers } from 'redux';
import storage from 'local-redux-storage';

const exampleReducer = (state = {}, action) => state

const reducer = storage(exampleReducer, 'exampleReducerKey')

const rootReducer = combineReducers({ 
    reducer,
    ...otherReducers 
})

const store = createStore(storage(rootReducer))

Example

Example project in example folder. Also live on https://local-redux-storage-example.netlify.app/.

License

ISC

Keywords

redux local storage

FAQs

Package last updated on 17 Aug 2021

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