import {Observable, Subject} from 'rxjs' export function createEventHandler(): [Observable, (event: Event) => void] { const events$: Subject = new Subject() return [events$.asObservable(), (event: Event) => events$.next(event)] }