use-promise
The usePromise hook consumes an asynchronous function is ideal for using fetch or other asynchronous tasks.
Module
import { usePromise } from "@atomico/hooks/use-promise";Syntax
const [result, status] = usePromise(
asyncFunction,
runFunction,
optionalArguments
);Example
Last updated
Was this helpful?
