@varlet/axle 0.9.1 → 0.9.3

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.
package/lib/use.cjs CHANGED
@@ -159,7 +159,7 @@ function createUseAxle(options) {
159
159
  downloadProgress.value = (_a2 = event.progress) != null ? _a2 : 0;
160
160
  }
161
161
  }, config));
162
- value.value = onTransform(response, refs);
162
+ value.value = await onTransform(response, refs);
163
163
  error.value = void 0;
164
164
  onSuccess(response, refs);
165
165
  loading.value = false;
package/lib/use.d.cts CHANGED
@@ -34,7 +34,7 @@ interface UseAxleOptions<V = any, R = any, P = Record<string, any>> {
34
34
  config?: AxleRequestConfig | (() => AxleRequestConfig);
35
35
  onBefore?(refs: UseAxleRefs<V>): void;
36
36
  onAfter?(refs: UseAxleRefs<V>): void;
37
- onTransform?(response: R, refs: UseAxleRefs<V>): V;
37
+ onTransform?(response: R, refs: UseAxleRefs<V>): V | Promise<V>;
38
38
  onSuccess?(response: R, refs: UseAxleRefs<V>): void;
39
39
  onError?(error: Error, refs: UseAxleRefs<V>): void;
40
40
  }
package/lib/use.d.ts CHANGED
@@ -34,7 +34,7 @@ interface UseAxleOptions<V = any, R = any, P = Record<string, any>> {
34
34
  config?: AxleRequestConfig | (() => AxleRequestConfig);
35
35
  onBefore?(refs: UseAxleRefs<V>): void;
36
36
  onAfter?(refs: UseAxleRefs<V>): void;
37
- onTransform?(response: R, refs: UseAxleRefs<V>): V;
37
+ onTransform?(response: R, refs: UseAxleRefs<V>): V | Promise<V>;
38
38
  onSuccess?(response: R, refs: UseAxleRefs<V>): void;
39
39
  onError?(error: Error, refs: UseAxleRefs<V>): void;
40
40
  }
package/lib/use.js CHANGED
@@ -121,7 +121,7 @@ function createUseAxle(options) {
121
121
  downloadProgress.value = (_a2 = event.progress) != null ? _a2 : 0;
122
122
  }
123
123
  }, config));
124
- value.value = onTransform(response, refs);
124
+ value.value = await onTransform(response, refs);
125
125
  error.value = void 0;
126
126
  onSuccess(response, refs);
127
127
  loading.value = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/axle",
3
- "version": "0.9.1",
3
+ "version": "0.9.3",
4
4
  "description": "Progressive request tool based on axios",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",