Re: [whatwg/dom] Removing event listeners through an identifier (#208)

I like this proposal.

> I also don't think it's a good idea to allow removing multiple groups using removeEventListener, because the semantics as you've described them are so different from those of addEventListener. addEventListener(type, cb, { groups: ["foo", "bar"] }) adds something with group "foo" and group "bar". Wheras removeEventListener({ groups: ["foo", "bar"] }) would, if I understand correctly, remove events with either "foo" or "bar". So I think if we allow passing multiple groups to removeEventListener, it should use the same semantics as addEventListener, and remove events with both "foo" and "bar". But maybe that's too confusing, so we should only support passing a single group value.

I think it is confusing that there is a difference between `addEventListener` and `removeEventListener` of a behavior of passing an iterable value to `group`.
`addEventListener` treats it as an iterable, but `removeEventListener` treats as a stringified value in spite of the same interface.

https://github.com/w3c/web-platform-tests/pull/6331/files#diff-5c1acdfc59932a9e59f60a2c246f1a80R157

I think it would be nice if `removeEventListener` treats it as an iterable or throws an error when a value that is not string or symbol.


-- 
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/issues/208#issuecomment-312809796

Received on Tuesday, 4 July 2017 08:06:43 UTC