redux-persist
redux-persist copied to clipboard
[Typescript suggestion] Stricter type checking for persist config
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected] for the project I'm working on.
Added stricter type checking for the blacklist and whitelist keys in redux-persist config. According to my understanding, this stricter type checking prevents entering invalid keys/strings as blacklist and whitelist, and also provides autocomplete when adding keys. Interested in hearing any thoughts that disagree, or reasons why this might not be a good change to make!
diff --git a/node_modules/redux-persist/types/types.d.ts b/node_modules/redux-persist/types/types.d.ts
index b3733bc..ac7517d 100644
--- a/node_modules/redux-persist/types/types.d.ts
+++ b/node_modules/redux-persist/types/types.d.ts
@@ -31,8 +31,8 @@ declare module "redux-persist/es/types" {
* @deprecated keyPrefix is going to be removed in v6.
*/
keyPrefix?: string;
- blacklist?: Array<string>;
- whitelist?: Array<string>;
+ blacklist?: Array<keyof S>;
+ whitelist?: Array<keyof S>;
transforms?: Array<Transform<HSS, ESS, S, RS>>;
throttle?: number;
migrate?: PersistMigrate;
This issue body was partially generated by patch-package.