@varlet/axle 0.11.0-alpha.1747141760435 → 0.11.1

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
@@ -198,7 +198,7 @@ function createUseAxle(options) {
198
198
  config: normalizeValueGetter(initialConfigOrGetter)
199
199
  });
200
200
  }
201
- if (abortOnUnmount) {
201
+ if (abortOnUnmount && (0, import_vue4.getCurrentInstance)()) {
202
202
  (0, import_vue4.onUnmounted)(() => {
203
203
  abort();
204
204
  });
package/lib/use.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-G2ADBYYC.js";
4
4
 
5
5
  // src/use.ts
6
- import { onUnmounted, ref as ref3 } from "vue";
6
+ import { getCurrentInstance, onUnmounted, ref as ref3 } from "vue";
7
7
  import { isFunction } from "rattail";
8
8
 
9
9
  // src/composables/useValues.ts
@@ -160,7 +160,7 @@ function createUseAxle(options) {
160
160
  config: normalizeValueGetter(initialConfigOrGetter)
161
161
  });
162
162
  }
163
- if (abortOnUnmount) {
163
+ if (abortOnUnmount && getCurrentInstance()) {
164
164
  onUnmounted(() => {
165
165
  abort();
166
166
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/axle",
3
- "version": "0.11.0-alpha.1747141760435",
3
+ "version": "0.11.1",
4
4
  "description": "Progressive request tool based on axios",
5
5
  "keywords": [
6
6
  "axle",