Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs Redux持久化覆盖缓存数据_Reactjs_Typescript_Redux - Fatal编程技术网

Reactjs Redux持久化覆盖缓存数据

Reactjs Redux持久化覆盖缓存数据,reactjs,typescript,redux,Reactjs,Typescript,Redux,我正在用react with typescript和redux处理一个项目。我有一个包含各种图形的页面和一个过滤器,用于选择特定数据来填充这些图形。我想实现一个缓存系统,有很多过滤器,重新加载或返回,必须再次选择所有的过滤器是一件痛苦的事情。过滤器是动态的,从服务器获取过滤器选项,然后将图形数据获取到选择过滤器。使用redux中的persistConfig,如下所示: const persistConfig = { key: 'getter', storage, whitelist:

我正在用react with typescript和redux处理一个项目。我有一个包含各种图形的页面和一个过滤器,用于选择特定数据来填充这些图形。我想实现一个缓存系统,有很多过滤器,重新加载或返回,必须再次选择所有的过滤器是一件痛苦的事情。过滤器是动态的,从服务器获取过滤器选项,然后将图形数据获取到选择过滤器。使用redux中的persistConfig,如下所示:

const persistConfig = {
  key: 'getter',
  storage,
  whitelist: ['auth', 'operationsPerDay'],
};
operationsPerDay缓存当前选定的筛选器选项和图形数据。过滤器选项按预期持久化,但缓存中的图形数据将被替换为空,而不是重复使用以填充图形。有什么见解吗?使过滤器和图形工作的整个代码放在这里非常大,但是如果需要,我可以提供更多信息。谢谢大家