Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china authored Aug 14, 2024
1 parent 73cfbf4 commit bfeb729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export const Component: React.FC = () => {

```tsx
import React from 'react'
import { watch, useRef, useEffectScope } from 'veact'
import { watch, useRef, useEffectScope, onScopeDispose } from 'veact'

export const Component: React.FC = () => {
const scope = useEffectScope()
Expand All @@ -229,6 +229,7 @@ export const Component: React.FC = () => {
const doubled = computed(() => counter.value * 2)
watch(doubled, (newValue) => console.log(newValue))
watchEffect(() => console.log('doubled: ', doubled.value))
onScopeDispose(() => console.log('effect scope is stopped'))
})

return (
Expand Down

0 comments on commit bfeb729

Please sign in to comment.