vue-use-async
Advanced tools
Comparing version
{ | ||
"name": "vue-use-async", | ||
"version": "0.0.1-beta.1", | ||
"version": "0.0.1", | ||
"description": "Xhr and async helpers", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -13,3 +13,5 @@ # Xhr helpers to use in back and client (VueJS) projects | ||
# Usage | ||
```javascript | ||
import { Xhr, useXhr, useAsync } from 'vue-use-async'; | ||
``` | ||
- Xhr Class | ||
@@ -28,11 +30,11 @@ | ||
promise, | ||
} = get({ url: '/fake/get', cacheDuration: 200 }); | ||
} = get({ url: '/', cacheDuration: 200 }); | ||
``` | ||
E.g; In `setup`, a computed bearer token can be used. Each query has data bind to be used | ||
directly in template. | ||
A cache can be specified, during the duration an other query with same parameters will be | ||
directly in a template. | ||
A cache can be specified, therefore during this time an other query with same parameters will be | ||
directly resolved. | ||
- useAsync, similar to `useXhr`. Can resolve a function when computed parameters changed. | ||
if `condition` is used, the function will wait `true` before be resolved. | ||
- useAsync, similar to `useXhr` can resolve a function when computed parameters changed. | ||
if `condition` is used, the function will wait `true` before being applied. | ||
```javascript | ||
@@ -39,0 +41,0 @@ const func = () => Promise.resolve('ok'); |
Sorry, the diff of this file is too big to display
96588
0.34%372
0.27%45
4.65%