- From: Jafar Husain <notifications@github.com>
- Date: Wed, 13 Dec 2017 17:21:25 +0000 (UTC)
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 13 December 2017 17:21:52 UTC
@benlesh Using map would be less ergonomic for this use case, because developers would be obligated to also return the function argument.
~~~js
button.on(“click”).map(e => {
e.preventDefaut():
return e;
}).first()
~~~
The do method would allow preventDefault() to be included in a function expression, and would consequently be more terse. Given how common this use case may be, the do method may be justified.
--
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/544#issuecomment-351460993
Received on Wednesday, 13 December 2017 17:21:52 UTC