【发布时间】:2017-09-22 00:40:22
【问题描述】:
我继承了一个使用 redux-persist 并且有多个 reducer 的项目。我为一个小功能编写了一个新的减速器,并坚持认为减速器会导致问题。它的行为应该与没有 redux-persist 的情况一样。
我怎样才能省略一个 reducer 的持久化?或者,如果我不能,我该如何手动清除它?在文档中,在这里:https://github.com/rt2zz/redux-persist,我发现了这个:
persistor object
the persistor object is returned by persistStore with the following methods:
.purge(keys)
keys array An array of keys to be purged from storage. If not provided all keys will be purged.
...
所以,这可能是我需要的,但我不知道在哪里以及如何使用它。
【问题讨论】: