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

I'm not sure if the downsides outweigh the benefits. It should be pretty obvious that I'm not familiar with this API, so I'm not in a position to give a considered opinion yet.

I do note that this issue is titled "Improving ergonomics of events with Observable", which implies to me that it's meant to make things easier for everyday use of events by typical developers, not just for advanced use cases where it is possible to be careful and get things right. Based on that, I expect it needs to be designed to be minimally dangerous to non-expert web developers. In that context, "there are some use cases where it's convenient and safe" is not a good answer to "this seems to create the risk of unexpected or unpredictable behavior".

There might be ways of getting events into the Promise ecosystem that create less risk of mistakes. Even something as simple as giving `first()` a different name might do it. Alternately, if this API is meant only for expert use, there's the possibility of giving `on()` a more off-putting name like `observableForEvent()`.



-- 
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-351793996

Received on Thursday, 14 December 2017 18:20:29 UTC