vue-computed-with-control 1.0.6 → 1.0.8

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/README.github.md CHANGED
@@ -4,12 +4,11 @@
4
4
 
5
5
  <h1 align="center">vue-computed-with-control</h1>
6
6
 
7
- <p align="center">A Vue 3 composition API utility that lets you explicitly control computed property updates with manual trigger functions and dependency tracking. Provides fine-grained control over when computations re-run.</p>
7
+ <p align="center"></p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-computed-with-control"><img src="https://img.shields.io/npm/v/vue-computed-with-control.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-computed-with-control"><img src="https://img.shields.io/npm/dm/vue-computed-with-control.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-computed-with-control/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-computed-with-control.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
14
  ## Installation
@@ -21,13 +20,7 @@ npm install vue-computed-with-control
21
20
  ## Usage
22
21
 
23
22
  ```ts
24
- import { computedWithControl } from 'vue-computed-with-control';
25
- ```
26
-
27
- Explicitly define the dependencies of computed.
28
-
29
- ```ts
30
- import { computedWithControl } from 'vue-computed-with-control'
23
+ import { computedWithControl } from '@vueuse/core'
31
24
 
32
25
  const source = ref('foo')
33
26
  const counter = ref(0)
@@ -38,50 +31,8 @@ const computedRef = computedWithControl(
38
31
  )
39
32
  ```
40
33
 
41
- With this, the changes of `counter` won't trigger `computedRef` to update but the `source` ref does.
42
-
43
- ```ts
44
- console.log(computedRef.value) // 0
45
-
46
- counter.value += 1
47
-
48
- console.log(computedRef.value) // 0
49
-
50
- source.value = 'bar'
51
-
52
- console.log(computedRef.value) // 1
53
- ```
54
-
55
- ### Manual Triggering
56
-
57
- You can also manually trigger the update of the computed by:
58
-
59
- ```ts
60
- const computedRef = computedWithControl(
61
- () => source.value,
62
- () => counter.value,
63
- )
64
-
65
- computedRef.trigger()
66
- ```
67
-
68
- ### Deep Watch
69
-
70
- Unlike `computed`, `computedWithControl` is shallow by default.
71
- You can specify the same options as `watch` to control the behavior:
72
-
73
- ```ts
74
- const source = ref({ name: 'foo' })
75
-
76
- const computedRef = computedWithControl(
77
- source,
78
- () => counter.value,
79
- { deep: true },
80
- )
81
- ```
82
-
83
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
84
-
85
34
  ## License
86
35
 
87
36
  MIT
37
+
38
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/README.md CHANGED
@@ -4,12 +4,11 @@
4
4
 
5
5
  <h1 align="center">vue-computed-with-control</h1>
6
6
 
7
- <p align="center">A Vue 3 composition API utility that lets you explicitly control computed property updates with manual trigger functions and dependency tracking. Provides fine-grained control over when computations re-run.</p>
7
+ <p align="center"></p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-computed-with-control"><img src="https://img.shields.io/npm/v/vue-computed-with-control.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-computed-with-control"><img src="https://img.shields.io/npm/dm/vue-computed-with-control.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-computed-with-control/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-computed-with-control.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
14
  ## Installation
@@ -21,13 +20,7 @@ npm install vue-computed-with-control
21
20
  ## Usage
22
21
 
23
22
  ```ts
24
- import { computedWithControl } from 'vue-computed-with-control';
25
- ```
26
-
27
- Explicitly define the dependencies of computed.
28
-
29
- ```ts
30
- import { computedWithControl } from 'vue-computed-with-control'
23
+ import { computedWithControl } from '@vueuse/core'
31
24
 
32
25
  const source = ref('foo')
33
26
  const counter = ref(0)
@@ -38,50 +31,8 @@ const computedRef = computedWithControl(
38
31
  )
39
32
  ```
40
33
 
41
- With this, the changes of `counter` won't trigger `computedRef` to update but the `source` ref does.
42
-
43
- ```ts
44
- console.log(computedRef.value) // 0
45
-
46
- counter.value += 1
47
-
48
- console.log(computedRef.value) // 0
49
-
50
- source.value = 'bar'
51
-
52
- console.log(computedRef.value) // 1
53
- ```
54
-
55
- ### Manual Triggering
56
-
57
- You can also manually trigger the update of the computed by:
58
-
59
- ```ts
60
- const computedRef = computedWithControl(
61
- () => source.value,
62
- () => counter.value,
63
- )
64
-
65
- computedRef.trigger()
66
- ```
67
-
68
- ### Deep Watch
69
-
70
- Unlike `computed`, `computedWithControl` is shallow by default.
71
- You can specify the same options as `watch` to control the behavior:
72
-
73
- ```ts
74
- const source = ref({ name: 'foo' })
75
-
76
- const computedRef = computedWithControl(
77
- source,
78
- () => counter.value,
79
- { deep: true },
80
- )
81
- ```
82
-
83
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
84
-
85
34
  ## License
86
35
 
87
36
  MIT
37
+
38
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/README.npm.md CHANGED
@@ -4,12 +4,11 @@
4
4
 
5
5
  <h1 align="center">vue-computed-with-control</h1>
6
6
 
7
- <p align="center">A Vue 3 composition API utility that lets you explicitly control computed property updates with manual trigger functions and dependency tracking. Provides fine-grained control over when computations re-run.</p>
7
+ <p align="center"></p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/vue-computed-with-control"><img src="https://img.shields.io/npm/v/vue-computed-with-control.svg" alt="npm version" /></a>
11
11
  <a href="https://www.npmjs.com/package/vue-computed-with-control"><img src="https://img.shields.io/npm/dm/vue-computed-with-control.svg" alt="npm downloads" /></a>
12
- <a href="https://github.com/vuefrag/vue-computed-with-control/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/vue-computed-with-control.svg" alt="license" /></a>
13
12
  </p>
14
13
 
15
14
  ## Installation
@@ -21,13 +20,7 @@ npm install vue-computed-with-control
21
20
  ## Usage
22
21
 
23
22
  ```ts
24
- import { computedWithControl } from 'vue-computed-with-control';
25
- ```
26
-
27
- Explicitly define the dependencies of computed.
28
-
29
- ```ts
30
- import { computedWithControl } from 'vue-computed-with-control'
23
+ import { computedWithControl } from '@vueuse/core'
31
24
 
32
25
  const source = ref('foo')
33
26
  const counter = ref(0)
@@ -38,50 +31,8 @@ const computedRef = computedWithControl(
38
31
  )
39
32
  ```
40
33
 
41
- With this, the changes of `counter` won't trigger `computedRef` to update but the `source` ref does.
42
-
43
- ```ts
44
- console.log(computedRef.value) // 0
45
-
46
- counter.value += 1
47
-
48
- console.log(computedRef.value) // 0
49
-
50
- source.value = 'bar'
51
-
52
- console.log(computedRef.value) // 1
53
- ```
54
-
55
- ### Manual Triggering
56
-
57
- You can also manually trigger the update of the computed by:
58
-
59
- ```ts
60
- const computedRef = computedWithControl(
61
- () => source.value,
62
- () => counter.value,
63
- )
64
-
65
- computedRef.trigger()
66
- ```
67
-
68
- ### Deep Watch
69
-
70
- Unlike `computed`, `computedWithControl` is shallow by default.
71
- You can specify the same options as `watch` to control the behavior:
72
-
73
- ```ts
74
- const source = ref({ name: 'foo' })
75
-
76
- const computedRef = computedWithControl(
77
- source,
78
- () => counter.value,
79
- { deep: true },
80
- )
81
- ```
82
-
83
- > Extracted from [VueUse](https://vueuse.org/) for standalone use.
84
-
85
34
  ## License
86
35
 
87
36
  MIT
37
+
38
+ Extracted from [VueUse](https://vueuse.org/) for standalone use.
package/banner.svg CHANGED
@@ -26,7 +26,7 @@
26
26
  <text x="80" y="280" font-family="system-ui, -apple-system, sans-serif" font-size="72" font-weight="700" fill="white">vue-computed-with-control</text>
27
27
 
28
28
  <!-- Description -->
29
- <text x="80" y="360" font-family="system-ui, -apple-system, sans-serif" font-size="32" fill="#94a3b8">Vue 3 computed with manual trigger and dependency control</text>
29
+ <text x="80" y="360" font-family="system-ui, -apple-system, sans-serif" font-size="32" fill="#94a3b8">Vue 3 composable utility</text>
30
30
 
31
31
  <!-- Install command -->
32
32
  <g transform="translate(80, 420)">
package/logo.svg CHANGED
@@ -1,29 +1,11 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96" width="256" height="256">
2
- <defs>
3
- <linearGradient id="bg-grad" x1="0%" y1="0%" x2="100%" y2="100%">
4
- <stop offset="0%" style="stop-color:#35495e;stop-opacity:1" />
5
- <stop offset="100%" style="stop-color:#1a252f;stop-opacity:1" />
6
- </linearGradient>
7
- </defs>
8
-
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 96 96">
9
2
  <!-- Background -->
10
- <rect width="96" height="96" rx="16" fill="url(#bg-grad)"/>
11
-
12
- <!-- Vue badge -->
13
- <g transform="translate(8, 8)">
14
- <rect width="18" height="9" rx="2" fill="#42b883"/>
15
- <text x="9" y="6.8" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="4.5" font-weight="700" fill="white">VUE</text>
16
- </g>
17
-
18
- <!-- Category icon -->
19
- <g>
20
- <circle cx="48" cy="28" r="12" fill="none" stroke="#42b883" stroke-width="3"/><circle cx="48" cy="28" r="5" fill="#42b883"/><path d="M36 28h-4M60 28h4M48 16v-4M48 40v4" stroke="#42b883" stroke-width="2" stroke-linecap="round"/>
21
- </g>
3
+ <rect width="96" height="96" rx="16" fill="#35495e"/>
22
4
 
23
- <!-- Function name - textLength ensures it fits within bounds -->
24
- <text x="48" y="60" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="7" font-weight="600" fill="white" textLength="80" lengthAdjust="spacingAndGlyphs">Computed With Control</text>
5
+ <!-- Primary shape -->
6
+ <circle cx="48" cy="42" r="20" fill="#42b883"/>
25
7
 
26
- <!-- Category label -->
8
+ <!-- Function name -->
27
9
  <text x="48" y="72" text-anchor="middle" font-family="system-ui, -apple-system, sans-serif" font-size="7" fill="#42b883" opacity="0.85">Reactivity</text>
28
10
 
29
11
  <!-- Bottom accent line -->
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-computed-with-control",
3
- "version": "1.0.6",
4
- "description": "Vue 3 computed with manual trigger and dependency control",
3
+ "version": "1.0.8",
4
+ "description": "Vue 3 composable utility",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -15,7 +15,8 @@
15
15
  "files": [
16
16
  "dist",
17
17
  "logo.svg",
18
- "banner.svg"
18
+ "banner.svg",
19
+ "README.md"
19
20
  ],
20
21
  "scripts": {
21
22
  "build": "unbuild",
@@ -23,24 +24,12 @@
23
24
  "postpublish": "cp README.github.md README.md"
24
25
  },
25
26
  "keywords": [
26
- "vue",
27
- "vue3",
28
- "vue-3",
29
- "composable",
30
- "composition-api",
31
- "vueuse",
32
- "reactive",
33
- "reactivity",
34
27
  "computed",
35
- "ref",
36
- "state",
37
- "with",
38
28
  "control",
39
29
  "manual",
40
30
  "trigger",
41
31
  "dependencies",
42
- "explicit",
43
- "computedWithControl"
32
+ "explicit"
44
33
  ],
45
34
  "author": "VueFrag",
46
35
  "license": "MIT",
@@ -60,4 +49,4 @@
60
49
  "typescript": "^5.0.0",
61
50
  "vue": "^3.4.0"
62
51
  }
63
- }
52
+ }