Skip to content

Commit a98c8ee

Browse files
committed
docs: make framework snippets reactive-safe
1 parent e58fcfc commit a98c8ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ const measured = computed(() =>
7575
layout(prepared.value, width.value, lineHeight.value)
7676
)
7777

78-
const { height, lineCount } = measured.value
78+
const height = computed(() => measured.value.height)
79+
const lineCount = computed(() => measured.value.lineCount)
7980
```
8081

8182
Angular (signals) example:
@@ -97,6 +98,9 @@ const prepared = computed(() =>
9798
const measured = computed(() =>
9899
layout(prepared(), width(), lineHeight())
99100
)
101+
102+
const height = computed(() => measured().height)
103+
const lineCount = computed(() => measured().lineCount)
100104
```
101105

102106
## Demos

0 commit comments

Comments
 (0)