"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.genericReducer = exports.toastsReducer = void 0;
const toastsReducer = (state, action) => {
    switch (action.type) {
        case 'add': {
            return { list: [action.toast, ...state.list] };
        }
        case 'remove': {
            return { list: state.list.filter(t => t.id !== action.toast.id) };
        }
        default: {
            throw new Error(`Unhandled action type: ${action.type}`);
        }
    }
};
exports.toastsReducer = toastsReducer;
const genericReducer = (state, action) => (state = action);
exports.genericReducer = genericReducer;
//# sourceMappingURL=reducers.js.map