Re: [whatwg/dom] Improving ergonomics of events with Observable (#544)

@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