Registry / storage / redux-localstorage-debounce

redux-localstorage-debounce

JSON →
library0.1.0jsnpmunverified

A storage enhancer for redux-localstorage that debounces persist requests to improve performance by delaying consecutive store changes and persisting them periodically. Version 0.1.0 is the latest stable release. It wraps lodash.debounce to provide a simple API: debounce(wait, maxWait). Useful in Redux apps with frequent state updates to avoid excessive writes to localStorage. Minimal footprint, no breaking changes known, but the redux-localstorage ecosystem is in maintenance mode.

npm install redux-localstorage-debounce
INSTALL
IMPORT
SIG · REDUX-LOCALSTORAGE
R
redux-localstorage-debounce
storagejavascriptv0.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

debounce
import { debounce } from 'redux-localstorage-debounce'
import debounce from 'redux-localstorage-debounce'
Named export, not default.
debounce
const { debounce } = require('redux-localstorage-debounce')
const debounce = require('redux-localstorage-debounce')
CommonJS: requires destructuring.
debounce (as storage enhancer)
compose(debounce(100))(adapter(localStorage))
debounce(100)(adapter(localStorage))
Must be composed via redux-localstorage's compose or manually.

Demonstrates basic setup: creating a Redux store with debounced localStorage persistence using redux-localstorage-debounce.

import { createStore, compose } from 'redux'; import { persistState } from 'redux-localstorage'; import adapter from 'redux-localstorage/lib/adapters/localStorage'; import { debounce } from 'redux-localstorage-debounce'; const reducer = (state = { count: 0 }, action) => { if (action.type === 'INCREMENT') return { count: state.count + 1 }; return state; }; const storageEnhancer = compose( debounce(100, 500), // wait 100ms, maxWait 500ms persistState('my-key') )(adapter(localStorage)); const store = createStore(reducer, storageEnhancer); store.dispatch({ type: 'INCREMENT' }); // Persist will debounce console.log('Store created with debounced persistence');
Debug
Known issues
deprecatedredux-localstorage ecosystem is in maintenance mode; consider using redux-persist for newer Redux patterns
fix
Migrate to redux-persist or other modern persistence solutions.
affects: >=0.1.0
gotchaEnsure compose is supplied by redux-localstorage, not redux itself, for storage enhancers
fix
Import compose from 'redux-localstorage' or use a custom compose function that accepts a single enhancer.
affects: >=0.1.0
breakingVersion 0.1.0 is the only release; no breaking changes known but little activity
fix
Check for updates; consider forking if issues arise.
affects: 0.1.0
Errors
Common errors & fixes
TypeError: (0 , _reduxLocalstorageDebounce.debounce) is not a function
Incorrect import (default instead of named)
fix
Use import { debounce } from 'redux-localstorage-debounce'
Error: compose(...): expected a function, got undefined
debounce not imported correctly or not applied inside compose
fix
Ensure debounce(100) is passed to compose, e.g., compose(debounce(100), persistState('key'))(adapter(localStorage))
Module not found: Can't resolve 'redux-localstorage/lib/adapters/localStorage'
Incorrect adapter path; redux-localstorage v1+ changed paths
fix
Use import adapter from 'redux-localstorage/lib/adapters/localStorage' or import { adapter } from 'redux-localstorage'
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
lodash.debouncerequiredDebounce implementation
redux-localstoragerequiredRequired to be composed into storage pipeline
Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources