Skip to content

Commit

Permalink
Update html_event_listener.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Feb 18, 2024
1 parent d88a396 commit a0e1aa1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/forky/forky_web/src/dom_utils/html_event_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ pub struct HtmlEventListener<T> {
}

impl<T> HtmlEventListener<T> {
#[must_use]
pub fn new<F>(name: &'static str, f: F) -> Self
where
F: FnMut(T) + 'static,
T: FromWasmAbi + 'static,
{
Self::new_with_target(name, f, window().unwrap().unchecked_into())
}
#[must_use]
pub fn new_with_target<F>(
name: &'static str,
f: F,
Expand Down

0 comments on commit a0e1aa1

Please sign in to comment.