Re: [whatwg/dom] Allow removing event listeners by group (#469)

Krinkle commented on this pull request.



> @@ -325,10 +325,23 @@ function imgFetched(ev) {
 }
 </pre>
 
-<a>Event listeners</a> can be removed
-by utilizing the
-{{EventTarget/removeEventListener()}}
-method, passing the same arguments.
+<a>Event listeners</a> can be removed by utilizing the
+{{EventTarget/removeEventListener(type, callback, options)}} method, passing the same arguments.
+
+Once can also provide a <em>group</em> when adding an <a>event listener</a>. This can be any value,
+including a simple string. Then later, the same group value can be provided to
+{{EventTarget/removeEventListener(type, options)}} or {{EventTarget/removeEventListener(options)}},
+to remove all event listeners in that group:
+
+<pre class=lang-javascript>
+oven.addEventListener("turnon", () => { &hellip; }, { group: "cookies" })

`cookies` is a fun and lightweight example word, but I think in this context it has greater chances of confusing less-experienced readers due to being a very over-loaded term. Perhaps we can come up with another example here, or if nothing else, plain `"example"`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/469#pullrequestreview-46418575

Received on Tuesday, 27 June 2017 00:28:31 UTC