{"id":17165749,"url":"https://github.com/vue-reactivity/watch","last_synced_at":"2026-01-27T11:37:59.220Z","repository":{"id":39124268,"uuid":"296433105","full_name":"vue-reactivity/watch","owner":"vue-reactivity","description":"The missing `watch` for @vue/reactivity","archived":false,"fork":false,"pushed_at":"2022-06-01T16:28:26.000Z","size":144,"stargazers_count":125,"open_issues_count":3,"forks_count":10,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-08-16T22:26:21.864Z","etag":null,"topics":["vue-reactivity","vue3","watch"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vue-reactivity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["antfu"]}},"created_at":"2020-09-17T20:17:29.000Z","updated_at":"2025-08-09T02:16:19.000Z","dependencies_parsed_at":"2022-07-18T03:00:33.231Z","dependency_job_id":null,"html_url":"https://github.com/vue-reactivity/watch","commit_stats":null,"previous_names":["antfu/vue-reactivity-watch"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/vue-reactivity/watch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Fwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Fwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Fwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Fwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vue-reactivity","download_url":"https://codeload.github.com/vue-reactivity/watch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vue-reactivity%2Fwatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vue-reactivity","vue3","watch"],"created_at":"2024-10-14T23:01:02.535Z","updated_at":"2026-01-27T11:37:59.204Z","avatar_url":"https://github.com/vue-reactivity.png","language":"TypeScript","funding_links":["https://github.com/sponsors/antfu"],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align='center'\u003e\n\u003cimg src='https://github.com/vue-reactivity/art/blob/master/svg/package-watch.svg?raw=true' height='250'\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\nThe (missing) \u003ckbd\u003ewatch\u003c/kbd\u003e for \u003ca href=\"https://github.com/vuejs/vue-next/tree/master/packages/reactivity\"\u003e\u003ccode\u003e@vue/reactivity\u003c/code\u003e\u003c/a\u003e. Works without Vue.\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@vue-reactivity/watch\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/@vue-reactivity/watch?color=43b883\u0026label=\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=@vue-reactivity/watch\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/@vue-reactivity/watch?color=364a5e\u0026label=\" alt=\"npm bundle size\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003cem\u003ewant to know how it works or write one on your own? Check out \u003ca href='https://antfu.me/posts/watch-with-reactivity/'\u003ethis blog post\u003c/a\u003e\u003c/em\u003e\n\u003c/p\u003e\n\n\n## Install\n\n\u003cpre\u003e\nnpm i @vue-reactivity/\u003cb\u003ewatch\u003c/b\u003e\n\u003c/pre\u003e\n\n### Usage\n\n\u003e Note: since there is no Vue instance to be bond, `watch` will **NOT** be auto disposed. You need to always **explicitly** call the returning function to stop it. Or you can try [@vue-reactivity/scope](https://github.com/vue-reactivity/scope) which will auto collect the effects for you. \n\nJust like what you do in Vue.\n\n```ts\nimport { ref, reactive, computed } from '@vue/reactivity'\nimport { watch, watchEffect } from '@vue-reactivity/watch'\n\nconst count = ref(1)\n\nconst stopWatch = watch(\n  count,\n  (newValue) =\u003e {\n    console.log(`Count: ${newValue}`)\n  }\n)\n\ncount.value += 1\n// Count: 2\n\nstopWatch()\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvue-reactivity%2Fwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvue-reactivity%2Fwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvue-reactivity%2Fwatch/lists"}