2022-01-03 09:30:54 -07:00
|
|
|
export const reducer = (state, action) => {
|
2022-01-07 10:59:15 -07:00
|
|
|
switch (action.type) {
|
|
|
|
case "sign_out":
|
2022-01-03 09:30:54 -07:00
|
|
|
|
2022-01-07 10:59:15 -07:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
active: !state.active
|
|
|
|
}
|
|
|
|
|
|
|
|
default:
|
|
|
|
return state
|
2022-01-03 09:30:54 -07:00
|
|
|
}
|
2022-01-07 10:59:15 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export const initialState = {
|
|
|
|
signedIn: false,
|
|
|
|
user: {
|
|
|
|
id: null,
|
|
|
|
username: null,
|
|
|
|
JWT: null,
|
|
|
|
},
|
|
|
|
}
|