tiefen_space_h5/store/reducers.js

30 lines
585 B
JavaScript
Raw Permalink Normal View History

2024-07-06 11:05:19 +08:00
"use client";
import { combineReducers } from "redux";
const initialState = {
authInfo: {
isSignin: false,
userToken: null,
2024-08-02 22:12:54 +08:00
recommendMid:null
2024-07-06 11:05:19 +08:00
},
};
let text = (data) => {
return data ? data.token : undefined;
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case "HANDLOGIN":
return { ...state, authInfo: action.data };
2024-08-02 22:12:54 +08:00
case "HANDLESAVERECOMMENMID":
return { ...state, recommendMid: action.data };
2024-07-06 11:05:19 +08:00
default:
return state;
}
};
const reducers = combineReducers({
reducer,
});
export default reducers;