This repository was archived by the owner on Jun 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
T/144: Refactor EmitterMixin methods. #190
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
08c64ed
Other: Make `EmitterMixin.listenTo` the main method instead of `Emitt…
jodator 9201e95
Fix: `DomEmitterMixin` works as before after refactoring `EmitterMixi…
jodator 70aca99
Tests: Update coverage in DomEmitterMixin tests.
jodator 2a9a431
Other: Make `EmitterMixin.off()` use `stopListening()` internally.
jodator 450829b
Code style: Rename private method to `removeCallback` in EmitterMixin.
jodator 9d0a033
Docs: Fix license banner in emittermixin.js.
jodator 3e0964e
Other: Use spread operator for passed arguments in `DomEmitterMixin.l…
jodator 9414e9b
Other: Remove isDomNode function that overlaps import in emittermixin.
jodator 4cf7e4a
Tests: Ignore safety check in emittermixin's private method.
jodator bb5a85f
Improved API docs.
Reinmar f1a92c1
Fixed broken license header.
Reinmar 86c8efc
Even more API docs fixes.
Reinmar 4e3c1e9
Removed unncessary code and added missing tests.
Reinmar 0ec921c
Tests: Added more tests for namespaced events.
jodator d3dbefb
Docs: Fixed links to dom/ProxyEmitter methods.
jodator 57feb2b
Tests: Added more test cases for dom/EmitterMixin.
jodator 809f249
Tests: Remove failing tests as not a part of an API yet.
jodator beedb07
Tests: Add tests for current `once()` behavior.
jodator ceaaff8
Merge branch 'master' into t/144-new
Reinmar cd21a75
Docs: Minor improvement.
Reinmar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
AFAICS,
event
can be undefined. Which means callingemitter.detach()
but its first param is not optional. Could you verify that it all works fine in cases wherestopListening()
's params are not passed?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.
You mean besides tests? The
event
parameter is check by theEmitterMixin.stopListening()
and also in heredom/EmitterMixinProxy.detach()
: https://github.com/ckeditor/ckeditor5-utils/pull/190/files/86c8efc9cff0415a01cdd3cd2a29aef81e1aadce#diff-99d3cd5d9460b6839252663e7c38b1c6R218 - actually it is checked if givenevent
is defined in_domListeners
so if it is falsy thendetach
will do nothing.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.
It's handled very poorly there, because if event is
undefined
then we dolisteners[ undefined ]
. And the API docs ofdetach()
are also incorrect.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.
In other words – if we expect
event
to be undefined then it should be handled explicitly. However, it's not the problem of your PR – it was like that in the past.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.
Actually, it seems to be a bug: https://github.com/ckeditor/ckeditor5-utils/issues/199