tiefen_space_h5/store/reducers.js

30 lines
585 B
JavaScript

"use client";
import { combineReducers } from "redux";
const initialState = {
authInfo: {
isSignin: false,
userToken: null,
recommendMid:null
},
};
let text = (data) => {
return data ? data.token : undefined;
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case "HANDLOGIN":
return { ...state, authInfo: action.data };
case "HANDLESAVERECOMMENMID":
return { ...state, recommendMid: action.data };
default:
return state;
}
};
const reducers = combineReducers({
reducer,
});
export default reducers;