vue-computed-eager 1.0.0 → 1.0.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/README.md +7 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -32,14 +32,15 @@ Learn more at [Vue: When a computed property can be the wrong tool](https://dev.
|
|
|
32
32
|
- Use `computedEager()` when you have a simple operation, with a rarely changing return value – often a boolean.
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
import {
|
|
35
|
+
import { ref } from 'vue';
|
|
36
|
+
import { computedEager } from 'vue-computed-eager';
|
|
36
37
|
|
|
37
|
-
const todos = ref([])
|
|
38
|
-
const hasOpenTodos = computedEager(() => !!todos.length)
|
|
38
|
+
const todos = ref([]);
|
|
39
|
+
const hasOpenTodos = computedEager(() => !!todos.value.length);
|
|
39
40
|
|
|
40
|
-
console.log(hasOpenTodos.value) // false
|
|
41
|
-
|
|
42
|
-
console.log(hasOpenTodos.value) // true
|
|
41
|
+
console.log(hasOpenTodos.value); // false
|
|
42
|
+
todos.value.push({ title: 'Learn Vue' });
|
|
43
|
+
console.log(hasOpenTodos.value); // true
|
|
43
44
|
```
|
|
44
45
|
|
|
45
46
|
## License
|
package/package.json
CHANGED