web
web copied to clipboard
Add additional event stream subscriptions to helpers
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)
.
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
.
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.