module
window
Window events for templates' @event: handler declarations (@resize: measure, @keydown: press(event.key)).
The browser installs a listener that uses window.addEventListener. Without one, listeners wait in a list that only dispatch calls: prerendering never does, so no window handler runs at build time, and tests send the events they need.
Functions
dispatch
pub fn dispatch(event: &Event)Send event to the window listeners waiting for its kind, as the browser would. Does nothing to a browser's listeners.
listen
pub fn listen(kind: &str, handler: Handler) -> CancelCall handler for each window event of kind until cancelled.
set_host
pub fn set_host(listen: Listen)Set what listens for window events (the browser does, when the app starts).