//notifications //delete restaurant //change picture //redesigned data store
13 lines
349 B
JavaScript
13 lines
349 B
JavaScript
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;
|