Comments (4)
Hi @dotintegral, sorry for the very late reply!
May I suggest the following solution?
function ignoreStates(statesToIgnore, state) {
return Object.keys(yourState).filter(function(key) {
if (statesToIgnore.indexOf(key) === -1) {
return key
}
})
}
applyMiddleware(save({
states: ignoreStates(['router', 'otherStateToIgnore', 'yetAnotherStateToIgnore'], yourState)
}))
...where yourState
is your reducer or combined reducers.
from redux-localstorage-simple.
@kilkelly Thanks for getting back.
As you wrote, I did something similar in my app. I just thought it would be pretty useful, if there would be such possibility out of the box.
It's never a big problem to write custom wrapper that does the additional logic, but it's always nice if the logic I'm looking for is already implemented and just can use it 😉
from redux-localstorage-simple.
Hi again @dotintegral . v2.2.0 released with ignoreStates
option added. Let me know if it works for you 👍
https://github.com/kilkelly/redux-localstorage-simple/releases/tag/v2.2.0
from redux-localstorage-simple.
Looks great! Thank you! 👍
from redux-localstorage-simple.
Related Issues (20)
- Dependency object-merge is missing HOT 3
- Vulnerability in dependency `merge` requires an update HOT 3
- Config question HOT 1
- Multiple save middlewares issue HOT 1
- redux-localstorage-simple vs redux-persist. Is this library production ready? HOT 1
- Changing save and load values in setup causes uninitialized values
- Need an example of Clear() HOT 1
- How to check if a particular state exists?
- combineLoads signature causes TypeScript error HOT 3
- TypeScript compile error HOT 3
- Error Handling HOT 2
- Uncaught SyntaxError: Unexpected token u in JSON at position 0 HOT 12
- Add namaespace separator option HOT 4
- Is this compatible with redux-toolkit ? HOT 3
- Handle multiple tabs gracefully
- remove module declaration from index.d.ts
- How do you bootstrap localstorage from Redux default state?
- GPL-3 Dependency HOT 3
- [Redux-LocalStorage-Simple] ReferenceError: localStorage is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-localstorage-simple.