-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore: upgrade eventemitter to v5.0.2 #7709
Changes from 4 commits
dc77e35
7df3d66
8fc2cce
bede498
caa398f
a394dcc
2396cc7
019be8d
72d3ecb
58c9101
5dd2565
71a3cc2
a3c3174
c323b5b
2fa20ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -237,13 +237,11 @@ export default { | |
} | ||
|
||
this.previewAction = new PreviewAction(this.openmct); | ||
this.previewAction.on('isVisible', this.togglePreviewState); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you're right. I wonder if our preview action changed at some point as it doesn't seem to have much benefit to emitting this 'isVisible' event at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
From v3.0.0 onwards, EventEmitter3 throws an error if you try to register a listener with a callback that is not a function There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this is being used for search results here: You can see an implementation here: |
||
}, | ||
unmounted() { | ||
this.openmct.time.off('timeSystem', this.updateTimeSystem); | ||
this.telemetryCollection.off('add', this.setLatestValues); | ||
this.telemetryCollection.off('clear', this.resetValues); | ||
this.previewAction.off('isVisible', this.togglePreviewState); | ||
|
||
this.telemetryCollection.destroy(); | ||
}, | ||
|
ozyx marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ const helperFunctions = { | |
} else if (object.addEventListener) { | ||
object.addEventListener(event, listener._cb); | ||
} else { | ||
object.on(event, listener._cb); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, so how was this working before? The context would have been undefined? |
||
object.on(event, listener._cb, listener.context); | ||
} | ||
|
||
this._listeningTo.push(listener); | ||
|
@@ -78,7 +78,7 @@ const helperFunctions = { | |
} else if (listener.object.removeEventListener) { | ||
listener.object.removeEventListener(listener.event, listener._cb); | ||
} else { | ||
listener.object.off(listener.event, listener._cb); | ||
listener.object.off(listener.event, listener._cb, listener.context); | ||
} | ||
|
||
return listener; | ||
|
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.
Whaaaat were we even doing here? Suspect this was a hangover from prototypical inheritance that was left in by mistake.
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.
Yup, exactly.