use_async_callback

Function use_async_callback 

Source
pub fn use_async_callback<'hook, IN, OUT, F, D>(
    deps: D,
    f: F,
) -> impl 'hook + Hook<Output = Callback<IN, ()>>
where IN: Clone + 'static + 'hook, OUT: IntoJsResult + 'static + 'hook, F: AsyncFn(IN, &D) -> OUT + 'static + 'hook, D: Clone + PartialEq + 'static + 'hook,
Expand description

Just like use_callback, except convenient for an async cresult body.

ยงNote

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

pub fn use_async_callback<IN, OUT, F, D>(deps: D, f: F) -> Callback<IN, ()>
where
    IN: Clone + 'static,
    OUT: IntoJsResult + 'static,
    F: AsyncFn(IN, &D) -> OUT + 'static,
    D: Clone + PartialEq + 'static,
{
    /* implementation omitted */
}