Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: remove event emitter type from interfaces #2196

Merged
merged 1 commit into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/interface/src/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ class CustomEventPolyfill<T = any> extends Event {

export const CustomEvent = globalThis.CustomEvent ?? CustomEventPolyfill

// TODO: remove this in v1
export { TypedEventEmitter as EventEmitter }

// create a setMaxListeners that doesn't break browser usage
export const setMaxListeners: typeof nodeSetMaxListeners = (n, ...eventTargets) => {
try {
Expand Down
4 changes: 2 additions & 2 deletions packages/peer-discovery-mdns/src/mdns.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomEvent, EventEmitter } from '@libp2p/interface/events'
import { CustomEvent, TypedEventEmitter } from '@libp2p/interface/events'
import { peerDiscovery } from '@libp2p/interface/peer-discovery'
import multicastDNS from 'multicast-dns'
import * as query from './query.js'
Expand All @@ -23,7 +23,7 @@ export interface MulticastDNSComponents {
logger: ComponentLogger
}

export class MulticastDNS extends EventEmitter<PeerDiscoveryEvents> implements PeerDiscovery, Startable {
export class MulticastDNS extends TypedEventEmitter<PeerDiscoveryEvents> implements PeerDiscovery, Startable {
public mdns?: multicastDNS.MulticastDNS

private readonly log: Logger
Expand Down