Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
levivilet committed Dec 27, 2024
1 parent 9bbabc1 commit f60ed5a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import type { EventEmitter } from 'node:events'
import type { FirstEvent } from '../FirstEvent/FirstEvent.ts'

const addListener = (emitter: EventEmitter, type: string, callback: any) => {
const addListener = (emitter: EventEmitter, type: string, callback: any): void => {
emitter.on(type, callback)
}

const removeListener = (emitter: EventEmitter, type: string, callback: any) => {
const removeListener = (emitter: EventEmitter, type: string, callback: any): void => {
emitter.off(type, callback)
}

export const getFirstEvent = (eventEmitter: EventEmitter, eventMap: any): Promise<FirstEvent> => {
const { resolve, promise } = Promise.withResolvers<FirstEvent>()
const listenerMap = Object.create(null)
const cleanup = (value: any) => {
const cleanup = (value: any): void => {
for (const event of Object.keys(eventMap)) {
removeListener(eventEmitter, event, listenerMap[event])
}
Expand Down

0 comments on commit f60ed5a

Please sign in to comment.