#[repr(transparent)]pub struct Hook<S> { /* private fields */ }
Expand description
Implementations§
source§impl<S> Hook<S>
impl<S> Hook<S>
sourcepub fn bind<E, F, O>(&self, callback: F) -> Bound<'_, S, F>where
S: 'static,
E: EventCast,
F: Fn(&mut S, E) -> O + 'static,
O: ShouldRender,
pub fn bind<E, F, O>(&self, callback: F) -> Bound<'_, S, F>where S: 'static, E: EventCast, F: Fn(&mut S, E) -> O + 'static, O: ShouldRender,
Binds a closure to a mutable reference of the state. While this method is public
it’s recommended to use the bind!
macro instead.
pub fn bind_async<E, F, T>(&self, callback: F) -> impl Listener<E>where S: 'static, E: EventCast, F: Fn(Signal<S>, E) -> T + 'static, T: Future<Output = ()> + 'static,
Trait Implementations§
source§impl<'a, V> View for &'a Hook<V>where
&'a V: View + 'a,
impl<'a, V> View for &'a Hook<V>where &'a V: View + 'a,
§type Product = <&'a V as View>::Product
type Product = <&'a V as View>::Product
The product should contain a DOM reference to this View and
any data it needs to update itself.
source§fn build(self, p: In<'_, Self::Product>) -> Out<'_, Self::Product>
fn build(self, p: In<'_, Self::Product>) -> Out<'_, Self::Product>
Build a product that can be mounted in the DOM from this type.
source§fn update(self, p: &mut Self::Product)
fn update(self, p: &mut Self::Product)
Update the product and apply changes to the DOM if necessary.