import { PushAdapter } from './common' ; /**
 * Convert node EventEmitter events to an async iterable iterator.
 */ const fromEmitter = < Event > ( init ) => ( type , emitter ) : AsyncIterableIterator < Event > => { const adapter = init ( ) ; const listener = ( event ) => void adapter . push ( event ) ; emitter . addListener ( type , listener ) ; return adapter . wrap ( ( ) => void emitter . removeListener ( type , listener ) ) ; } ; export default fromEmitter ;