0.0.1 • Published 1 year ago

@reactivity-vue/watch v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@reactivity-vue/watch

NPM version

The (missing) watch for @vue/reactivity. Works without Vue.

Install

npm install --save-dev @reactivity-vue/watch

Usage

import { computed, reactive, ref } from '@vue/reactivity'
import { watch, watchEffect } from '@reactivity-vue/watch'
const count = ref(1)
const stopWatch = watch(
  count,
  (newValue) => {
    console.log(`Count: ${newValue}`)
  }
)
count.value += 1
// Count: 2
stopWatch()

License

MIT License © 2023 Elone Hoo