# Lazy Promise
Sugar for usePromise (opens new window)
This is only a sugar method to call Promise, passing the option for lazy, might not be clear enough.
# Parameters
import { usePromiseLazy } from "vue-composable";
const use = usePromiseLazy(fn, throwException?);
Parameters | Type | Required | Default | Description |
---|---|---|---|---|
fn | Function | true | Promise factory | |
throwException | Boolean | false | false | Exposes exception on exec() |
# State
Check usePromise#State (opens new window)
# Methods
Check usePromise#Methods (opens new window)
# Implementation
// this is basically the code for this with no typings
function usePromiseLazy(fn, throwException) {
return usePromise(fn, {
lazy: true,
throwException
});
}