import { AnyEventCreator , Event } from '../../core/createEvent/createEvent.h' ; import { getEventType } from '../getEventType/getEventType' ; import { isArray } from '../is/isArray/isArray' ; export function select ( eventCreator ) { if ( isArray ( eventCreator ) ) { return selectArray ( eventCreator ) ; } const type = getEventType ( eventCreator ) ; return ( event ) => type === event . type ; } deprecated param eventCreators export function selectArray ( eventCreators ) { const types = eventCreators . map ( ( eventCreator ) => getEventType ( eventCreator ) ) ; return ( event ) => types . indexOf ( event . type ) >= 0 ; }