@data-fair/lib-vue 1.26.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/fetch.d.ts +1 -0
  2. package/fetch.js +3 -0
  3. package/package.json +1 -1
package/fetch.d.ts CHANGED
@@ -6,6 +6,7 @@ export type UseFetchOptions = {
6
6
  watch?: Boolean;
7
7
  notifError?: Boolean;
8
8
  immediate?: Boolean;
9
+ waitFor?: MaybeRefOrGetter<Boolean>;
9
10
  };
10
11
  type OptionalUrl = string | null | undefined;
11
12
  export declare function useFetch<T>(url: MaybeRefOrGetter<OptionalUrl>, options?: UseFetchOptions): {
package/fetch.js CHANGED
@@ -8,6 +8,9 @@ export function useFetch(url, options = {}) {
8
8
  url = computed(url);
9
9
  const fullUrl = computed(() => {
10
10
  let fullUrl = toValue(url);
11
+ const waitFor = toValue(options.waitFor);
12
+ if (waitFor === false)
13
+ return null;
11
14
  if (!fullUrl)
12
15
  return null;
13
16
  const query = toValue(options.query);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@data-fair/lib-vue",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "description": "Composables and other utilities for Vue applications in the data-fair stack.",
5
5
  "main": "index.js",
6
6
  "files": [