Want to know why the attribute of emit
in EventEmitter is protected
?
#3845
Unanswered
fw6
asked this question in
Questions & Help
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to emit a custom event externally.
So first of all I extend the interface of
EditorEvents
:but when I emit the 'protect' event(
editor.emit('protect', { editor })
), prompt me the messageProperty 'emit' is protected and only accessible within class 'EventEmitter<T>' and its subclasses.
.EventEmitter.emit
Is there any special reason to use it as a protected field? If not, can I replace it with
public
?Beta Was this translation helpful? Give feedback.
All reactions