Move event return to HTML crate

This commit is contained in:
Jonathan Kelley committed 2023-02-08 15:51:28 -08:00
1 parent ffb2b6f4de
commit a6c13c8ad0
4 files changed
+34 -30

No files matched your search

-19
View File
@@ -3,10 +3,6 @@ use std::{
rc::Rc,
};
use futures_util::Future;
use crate::ScopeState;
/// A wrapper around some generic data that handles the event's state
///
///
@@ -111,21 +107,6 @@ impl<T: std::fmt::Debug> std::fmt::Debug for Event<T> {
}
#[doc(hidden)]
pub trait EventReturn<P>: Sized {
fn spawn(self, _cx: &ScopeState) {}
}
impl EventReturn<()> for () {}
pub struct AsyncMarker;
impl<T> EventReturn<AsyncMarker> for T
where
T: Future<Output = ()> + 'static,
{
fn spawn(self, cx: &ScopeState) {
cx.spawn(self);
}
}
/// The callback type generated by the `rsx!` macro when an `on` field is specified for components.
///