tiefen_space_app/utils/loginReducer.js

19 lines
357 B
JavaScript
Raw Normal View History

2023-12-29 00:27:44 +08:00
import React from "react";
export default function loginReducer(prevState, action) {
switch (action.type) {
case "SIGN_IN":
return {
...prevState,
isSignin: true,
userToken: action.token,
};
case "SIGN_OUT":
return {
...prevState,
isSignin: false,
userToken: null,
};
}
}