tiefen_space_h5/store/reducers.js

27 lines
475 B
JavaScript
Raw Normal View History

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