import { filter , map } from 'rxjs/operators' ; import { alertPermanentlyIgnored } from './actions' ; import { ALERT_DISMISSED } from './constants' ; import type { Action , Epic } from '../types' ; import type { AlertDismissedAction } from './types' ; export const alertsEpic = ( action$ , state$ ) => { return action$ . pipe ( filter < Action , AlertDismissedAction > ( ( a ) : a is AlertDismissedAction => a . type === ALERT_DISMISSED && a . payload . remember ) , map ( dismiss => alertPermanentlyIgnored ( dismiss . payload . alertId ) ) ) ; } ;