removed custom context system
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export const menuReducer = (state, action) => {
|
||||
switch (action) {
|
||||
case 'show': return true;
|
||||
case 'hide': return false;
|
||||
case 'toggle': return !state;
|
||||
default: throw new Error("menustate unknown to reducer");
|
||||
}
|
||||
}
|
||||
|
||||
export const sessionReducer = (state, action) => {
|
||||
switch (action.type) {
|
||||
case 'start': return {active: true, token: action.token, username: action.username}
|
||||
case 'end': return {active: false, token: null, username: null, exiry: null}
|
||||
default: throw new Error("action type unknown to session reducer");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user