Skip to content

Commit e44e963

Browse files
authored
Merge pull request #67 from usingbrain/main
pull in changes
2 parents 86d9c03 + ce181e9 commit e44e963

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

client/src/store/actions.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ export const setHistory = (showing: boolean) => ({
3131
type: 'SET_HISTORY',
3232
showing,
3333
});
34+
35+
export const setCurrentList = (students: User[] | null) => ({
36+
type: 'SET_LIST',
37+
students,
38+
});

client/src/store/reducers.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,28 @@ const history: historyReducer = (state = false, action) => {
8787
}
8888
};
8989

90+
type currentListReducer = (
91+
state: User[] | null,
92+
action: { type: string; students: User[] | null }
93+
) => User[] | null;
94+
95+
const currentList: currentListReducer = (state = null, action) => {
96+
switch (action.type) {
97+
case 'SET_LIST':
98+
return action.students;
99+
default:
100+
return state;
101+
}
102+
};
103+
90104
const reducers = combineReducers({
91105
user,
92106
courses,
93107
selectedCourse,
94108
session,
95109
form,
96110
history,
111+
currentList,
97112
});
98113

99114
export default reducers;

0 commit comments

Comments
 (0)