Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
3d8982f8
Commit
3d8982f8
authored
Nov 12, 2021
by
Eduardo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply suggestions from code review
Co-authored-by:
Robert Knight
<
robertknight@gmail.com
>
parent
2eba3b24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
listener-collection.js
src/shared/listener-collection.js
+3
-2
listener-collection-test.js
src/shared/test/listener-collection-test.js
+1
-1
No files found.
src/shared/listener-collection.js
View file @
3d8982f8
...
...
@@ -16,7 +16,7 @@ export class ListenerCollection {
}
/**
* Add
s a listener and returns a listenerId
* Add
a listener and return an ID that can be used to remove it later
*
* @param {Listener['eventTarget']} eventTarget
* @param {Listener['eventType']} eventType
...
...
@@ -31,7 +31,8 @@ export class ListenerCollection {
}
/**
* Removes a listener using a listenerId
* Remove a listener using a listenerId
*
* @param {Symbol} listenerId
*/
remove
(
listenerId
)
{
...
...
src/shared/test/listener-collection-test.js
View file @
3d8982f8
...
...
@@ -22,7 +22,7 @@ describe('ListenerCollection', () => {
});
describe
(
'#remove'
,
()
=>
{
it
(
'unregisters
some event listeners
'
,
()
=>
{
it
(
'unregisters
the specified listener
'
,
()
=>
{
const
listener1
=
sinon
.
stub
();
const
listener2
=
sinon
.
stub
();
listeners
.
add
(
window
,
'resize'
,
listener1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment