rt2zz / redux-persist

persist and rehydrate a redux store
MIT License
12.94k stars 866 forks source link

Whitelist & blacklist should support regex #1283

Open flavinger opened 3 years ago

flavinger commented 3 years ago

Reopening an issue discussed in https://github.com/rt2zz/redux-persist/pull/324 that had a code fix but was closed before pushing the change.

For example:

then it will support: persistStore(store, { blacklist: [ /^_/, k => k.length > 20, ], }, onComplete) states with name underscore(_) prefixed or longer then 20, will not be persisted