feat: refactor the cache

This commit is contained in:
zerosoul
2022-03-04 10:15:30 +08:00
parent b6b0a0c5ef
commit acd007fb71
28 changed files with 622 additions and 341 deletions
+13 -1
View File
@@ -6,6 +6,12 @@ const userMsgSlice = createSlice({
name: "userMessage",
initialState,
reducers: {
clearUserMsg() {
return initialState;
},
initUserMsg(state, action) {
return action.payload;
},
addUserMsg(state, action) {
const {
id,
@@ -44,5 +50,11 @@ const userMsgSlice = createSlice({
},
},
});
export const { addUserMsg, setUserMsgRead, removeMsg } = userMsgSlice.actions;
export const {
clearUserMsg,
initUserMsg,
addUserMsg,
setUserMsgRead,
removeMsg,
} = userMsgSlice.actions;
export default userMsgSlice.reducer;