local-redux-storage
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

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

Package Sidebar

Install

npm i local-redux-storage

Weekly Downloads

0

Version

1.0.9

License

ISC

Unpacked Size

3.58 kB

Total Files

4

Last publish

Collaborators

  • sercanpaspal