Registry / other / gloo-events

gloo-events

JSON →
library0.3.0rscratesunverified

Convenience crate for working with DOM event listeners.

# Cargo.toml [dependencies] gloo-events = "0.3.0"
INSTALL
IMPORT
SIG · GLOO-EVENTS
G
gloo-events
otherrustv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

EventListener
use gloo_events::EventListener;

Add a click event listener to the window.

use gloo_events::EventListener; fn main() { let listener = EventListener::new(&web_sys::window().unwrap(), "click", |_| { web_sys::console::log_1(&"Clicked!".into()); }); // listener is dropped when out of scope }
Debug
Known issues
gotchaOnly works in WebAssembly environments.
fix
Target wasm32-unknown-unknown and use web-sys.
affects: >=0.3.0
Upgrade
Version history
0.3.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
gloo-events — cargo add gloo-events · libregistry