redux-store

Redux: My state is receiving '@@redux/INITi.8.g.w.a.m' Redux state not updating

大憨熊 提交于 2020-06-17 11:33:00
问题 I've been debugging why my state hasn't been changing and noticed this being logged in my reducer: { type: '@@redux/INITi.8.g.w.a.m' } This is the store which includes state, action types, reducer, actions: /* initial state */ import axios from 'axios'; export var usersStartState = { accountNotVerified: null, isLoggedIn: false, error: true, userAvatar: 'uploads/avatar/placeholder.jpg' }; /* action types */ export const actionTypes = { RESET_USER_ACCOUNT_IS_VERIFIED: 'RESET_USER_ACCOUNT_IS

Redux: My state is receiving '@@redux/INITi.8.g.w.a.m' Redux state not updating

Deadly 提交于 2020-06-17 11:28:05
问题 I've been debugging why my state hasn't been changing and noticed this being logged in my reducer: { type: '@@redux/INITi.8.g.w.a.m' } This is the store which includes state, action types, reducer, actions: /* initial state */ import axios from 'axios'; export var usersStartState = { accountNotVerified: null, isLoggedIn: false, error: true, userAvatar: 'uploads/avatar/placeholder.jpg' }; /* action types */ export const actionTypes = { RESET_USER_ACCOUNT_IS_VERIFIED: 'RESET_USER_ACCOUNT_IS

How to reset the state of a Redux store?

别说谁变了你拦得住时间么 提交于 2019-11-26 00:17:14
问题 I am using Redux for state management. How do I reset the store to its initial state? For example, let’s say I have two user accounts ( u1 and u2 ). Imagine the following sequence of events: User u1 logs into the app and does something, so we cache some data in the store. User u1 logs out. User u2 logs into the app without refreshing the browser. At this point, the cached data will be associated with u1 , and I would like to clean it up. How can I reset the Redux store to its initial state