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

Function use_worker_subscription

Source
pub fn use_worker_subscription<'hook, T>() -> impl 'hook + Hook<Output = UseWorkerSubscriptionHandle<T>>
where T: Worker + 'static + 'hook,
Expand description

A hook to subscribe to the outputs of a Worker agent.

All outputs sent to current bridge will be collected into a slice.

ยงNote

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

pub fn use_worker_subscription<T>() -> UseWorkerSubscriptionHandle<T>
where
    T: Worker + 'static,
{
    /* implementation omitted */
}