This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on docs.rs.
yew_agent::reactor

Function use_reactor_bridge

Source
pub fn use_reactor_bridge<'hook, R, F>(
    on_output: F,
) -> impl 'hook + Hook<Output = UseReactorBridgeHandle<R>>
where R: 'static + Reactor + 'hook, F: Fn(ReactorEvent<R>) + 'static + 'hook,
Expand description

A hook to bridge to a Reactor.

This hooks will only bridge the reactor once over the entire component lifecycle.

Takes a callback as the argument.

The callback will be updated on every render to make sure captured values (if any) are up to date.

ยงNote

When used in function components and hooks, this hook is equivalent to:

pub fn use_reactor_bridge<R, F>(on_output: F) -> UseReactorBridgeHandle<R>
where
    R: 'static + Reactor,
    F: Fn(ReactorEvent<R>) + 'static,
{
    /* implementation omitted */
}