Function use_api

Source
pub fn use_api<'hook, R>(
    request: R,
) -> impl 'hook + Hook<Output = SuspensionResult<Result<R::Output, R::Error>>>
where R: 'hook + Request + 'static,
Expand description

The basic api hook which requests data on mount and preserves its data through out the component lifetime

ยงNote

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

pub fn use_api<R: Request + 'static>(
    request: R,
) -> SuspensionResult<Result<R::Output, R::Error>> {
    /* implementation omitted */
}