@unhead/vue 1.11.5 → 1.11.6

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/dist/index.cjs CHANGED
@@ -51,19 +51,19 @@ function useScript(_input, _options) {
51
51
  options.trigger = vue.onMounted;
52
52
  } else if (vue.isRef(options.trigger)) {
53
53
  const refTrigger = options.trigger;
54
+ let off;
54
55
  options.trigger = new Promise((resolve) => {
55
- const off = vue.watch(refTrigger, (val) => {
56
+ off = vue.watch(refTrigger, (val) => {
56
57
  if (val) {
57
- off();
58
58
  resolve(true);
59
59
  }
60
60
  }, {
61
61
  immediate: true
62
62
  });
63
- vue.onScopeDispose(() => {
64
- off();
65
- resolve(false);
66
- }, true);
63
+ vue.onScopeDispose(() => resolve(false), true);
64
+ }).then((val) => {
65
+ off?.();
66
+ return val;
67
67
  });
68
68
  }
69
69
  head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
package/dist/index.mjs CHANGED
@@ -51,19 +51,19 @@ function useScript(_input, _options) {
51
51
  options.trigger = onMounted;
52
52
  } else if (isRef(options.trigger)) {
53
53
  const refTrigger = options.trigger;
54
+ let off;
54
55
  options.trigger = new Promise((resolve) => {
55
- const off = watch(refTrigger, (val) => {
56
+ off = watch(refTrigger, (val) => {
56
57
  if (val) {
57
- off();
58
58
  resolve(true);
59
59
  }
60
60
  }, {
61
61
  immediate: true
62
62
  });
63
- onScopeDispose(() => {
64
- off();
65
- resolve(false);
66
- }, true);
63
+ onScopeDispose(() => resolve(false), true);
64
+ }).then((val) => {
65
+ off?.();
66
+ return val;
67
67
  });
68
68
  }
69
69
  head._scriptStatusWatcher = head._scriptStatusWatcher || head.hooks.hook("script:updated", ({ script: s }) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unhead/vue",
3
3
  "type": "module",
4
- "version": "1.11.5",
4
+ "version": "1.11.6",
5
5
  "author": "Harlan Wilton <harlan@harlanzw.com>",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -67,9 +67,9 @@
67
67
  "dependencies": {
68
68
  "defu": "^6.1.4",
69
69
  "hookable": "^5.5.3",
70
- "@unhead/schema": "1.11.5",
71
- "unhead": "1.11.5",
72
- "@unhead/shared": "1.11.5"
70
+ "@unhead/shared": "1.11.6",
71
+ "@unhead/schema": "1.11.6",
72
+ "unhead": "1.11.6"
73
73
  },
74
74
  "scripts": {
75
75
  "build": "unbuild .",