27 lines
475 B
JavaScript
27 lines
475 B
JavaScript
|
|
||
|
"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;
|