[][src]Module mogwai::utils

Helpers and utilities.

Functions

add_event

Add an event of the given name on the given target, transmitting any triggered events into the given Transmitter. Returns the wrapped JS callback.

body

Return the DOM body.

document

Return the DOM web_sys::Document

remove_event

Remove an event of the given name from the given target.

request_animation_frame

Sets a static rust closure to be called with window.requestAnimationFrame. The given function may return whether or not this function should be rescheduled. If the function returns true it will be rescheduled. Otherwise it will not. The static rust closure takes one parameter which is a timestamp representing the number of milliseconds since the application's load. See https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp for more info.

set_checkup_interval

Set a callback closure to be called in a given number of milliseconds.

set_immediate

Schedule the given closure to be run as soon as possible.

timeout

Sets a static rust closure to be called after a given amount of milliseconds. The given function may return whether or not this timeout should be rescheduled. If the function returns true it will be rescheduled. Otherwise it will not.

wait_approximately

Wait approximately the given number of milliseconds. Returns a Future that yields the actual number of milliseconds waited.

window

Return the DOM web_sys::Window.