Module leptos_dom::helpers
source · Expand description
A variety of DOM utility functions.
Structs
- Handle that is generated by request_animation_frame_with_handle and can be used to cancel the animation frame request.
- Handle that is generated by request_idle_callback_with_handle and can be used to cancel the idle callback.
- Handle that is generated by set_interval and can be used to clear the interval.
- Handle that is generated by set_timeout_with_handle and can be used to clear the timeout.
Functions
- “Debounce” a callback function. This will cause it to wait for a period of
delayafter it is called. If it is called again during that period, it will waitdelaybefore running, and so on. This can be used, for example, to wrap event listeners to prevent them from firing constantly as you type. - Helper function to extract
Event.targetfrom any event. - Helper function to extract
event.target.checkedfrom an event. - Helper function to extract
event.target.valuefrom an event. - Gets the value of a property set on a DOM element.
- Returns the current
window.location. - Current
window.location.hashwithout the beginning #. - Current
window.location.pathname. - Runs the given function between the next repaint using
Window.requestAnimationFrame. - Runs the given function between the next repaint using
Window.requestAnimationFrame, returning a cancelable handle. - Queues the given function during an idle period using
Window.requestIdleCallback. - Queues the given function during an idle period using
Window.requestIdleCallback, returning a cancelable handle. - set_intervalDeprecatedRepeatedly calls the given function, with a delay of the given duration between calls, returning a cancelable handle. See
setInterval(). - Repeatedly calls the given function, with a delay of the given duration between calls, returning a cancelable handle. See
setInterval(). - Sets a property on a DOM element.
- Executes the given function after the given duration of time has passed.
setTimeout(). - Executes the given function after the given duration of time has passed, returning a cancelable handle.
setTimeout(). - Adds an event listener to the
Window.