import { UPDATE_NOTIFICATION } from '../actions/notification-fcm';
const INITIAL_STATE = {
    badge: 0,
    history: []
};
function countBadge(history) {
    return history.filter(notification => !notification.confirmed).length;
}
const notification = (state = INITIAL_STATE, action) => {
    switch (action.type) {
        case UPDATE_NOTIFICATION:
            var history = action.history;
            return {
                badge: countBadge(history),
                history
            };
        default:
            return state;
    }
};
export default notification;
//# sourceMappingURL=notification.js.map