-
Notifications
You must be signed in to change notification settings - Fork 43
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: use typed event emitter class #470
fix: use typed event emitter class #470
Conversation
detail: { peerId: from, subscriptions } | ||
}) | ||
) | ||
this.safeDispatchEvent<SubscriptionChangeData>('subscription-change', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This style of invocation type-checks the detail
field.
Looks like the custom linting rules in this repo are broken. Upgrading @typescript-eslint/parser may help - or since aegir is being used to build this project, perhaps delete all the custom eslint stuff and just use aegir's linting? |
The typed `EventEmitter` class from `@libp2p/interface/events` has been renamed `TypedEventEmitter` along with a `TypedEventTarget` interface. The old name is still exported so it's a backwards compatible change but it will be removed in a future version of `@libp2p/interface` so this change future-proofs `@chainsafe/libp2p-gossipsub` against that upcoming release.
fef6d0a
to
7e2fbe0
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #470 +/- ##
==========================================
- Coverage 81.35% 81.35% -0.01%
==========================================
Files 48 48
Lines 12267 12265 -2
Branches 1291 1291
==========================================
- Hits 9980 9978 -2
Misses 2287 2287 ☔ View full report in Codecov by Sentry. |
The typed
EventEmitter
class from@libp2p/interface/events
has been renamedTypedEventEmitter
along with aTypedEventTarget
interface.The old name is still exported so it's a backwards compatible change but it will be removed in a future version of
@libp2p/interface
so this change future-proofs@chainsafe/libp2p-gossipsub
against that upcoming release.