import { ObservableEventType , IObservableEventData } from '.' ; type ObservableEventPattern < R > = { [ T in ObservableEventType ] : ( data : IObservableEventData [ T ] ) => R ; } ; export default function matchObservableEvent < R > ( pattern ) { return ( e ) => { return pattern [ e . observableEvent ] ( e . data as any ) ; } ; }