Move event return to HTML crate
This commit is contained in:
1 parent
ffb2b6f4de
commit
a6c13c8ad0
4 files changed
+34
-30
No files matched your search
@@ -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.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user