vue-compose-promise
Promises using vue composition api.
Easily manipulate Promises and their state in Vue.
Installation
Usage
Both, pendingDelay
and promise
can be reactive values like a computed property, a ref or a prop:
API
usePromise<T>(options?: { pendingDelay?: number | Ref<number>; promise?: Promise<T> | Ref<Promise<T>> })
options
pendingDelay
: amount of time in ms that should be wait whenever the a new promise is pending. This allows delaying the display of a loader to avoid flashing the screen. Can be a reactive property.promise
: initial promise. Can be null. Can be a reactive property.