web client v0.5
//notifications //delete restaurant //change picture //redesigned data store
This commit is contained in:
12
src/reducers/notifications.js
Normal file
12
src/reducers/notifications.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const notifications = (state = [], action) => {
|
||||
switch (action.type) {
|
||||
case "ENQUEUE_SNACKBAR":
|
||||
return [...state, { key: action.key, ...action.notification }];
|
||||
case "REMOVE_SNACKBAR":
|
||||
return state.filter((notification) => notification.key !== action.key);
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
|
||||
export default notifications;
|
||||
Reference in New Issue
Block a user