注销时完全删除或重置 redux thunk 存储

Delete or Reset redux thunk store completely while logout

我在我的 React Native 项目中使用 redux, react-redux and redux thunk 进行 store 管理,有不同的 reducersactions。我如何 reset 在注销

期间整个 store

有没有像createStore()这样的方法来销毁商店? 请分享可能的解决方案

谢谢

以下解决方案对我有用,

import reduxReset from 'redux-reset'

const enHanceCreateStore = compose(
    applyMiddleware(thunk),
    reduxReset()  
  )(createStore)

const store = enHanceCreateStore(reducers)

调度重置动作

store.dispatch({
  type: 'RESET'
})