web icon indicating copy to clipboard operation
web copied to clipboard

Add additional event stream subscriptions to helpers

Open srujzs opened this issue 1 year ago • 2 comments

We have a small set today, but it would be nice to have more helpers like html.window.onClick so you don't have to write html.EventStreamProvider<html.MouseEvent>('click').forTarget(html.window).

srujzs avatar Sep 21 '23 18:09 srujzs

Another one that is quite common in my opinion: onLoad events (and friends). In dart:html you could do await element.onLoad.first. But now you need a Completer + allowInterop on the onload event handler.

Would be nice if this was also done for us, so we just need await element.onLoad.

navaronbracke avatar Oct 28 '23 11:10 navaronbracke

I think onLoad already exists in the helpers here: https://github.com/dart-lang/web/blob/e0564a4cc3cb96c88d15def1c545aa8dff375d94/lib/src/helpers/events/events.dart#L106

Agreed that our helpers should include more events however.

srujzs avatar Nov 07 '23 20:11 srujzs