{"id":15631640,"url":"https://github.com/sxzz/vue-functional-ref","last_synced_at":"2026-05-04T08:06:17.574Z","repository":{"id":58561250,"uuid":"530559782","full_name":"sxzz/vue-functional-ref","owner":"sxzz","description":"Functional-style refs for Vue reactivity.","archived":false,"fork":false,"pushed_at":"2025-09-29T21:55:15.000Z","size":868,"stargazers_count":189,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T23:41:47.377Z","etag":null,"topics":[],"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/sxzz.png","metadata":{"funding":{"github":["sxzz"]},"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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-08-30T08:12:16.000Z","updated_at":"2025-08-24T01:57:51.000Z","dependencies_parsed_at":"2023-02-16T06:16:07.976Z","dependency_job_id":"eaf6b516-4af1-4e56-8308-1f497ba707fd","html_url":"https://github.com/sxzz/vue-functional-ref","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/sxzz/vue-functional-ref","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxzz%2Fvue-functional-ref","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxzz%2Fvue-functional-ref/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxzz%2Fvue-functional-ref/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxzz%2Fvue-functional-ref/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sxzz","download_url":"https://codeload.github.com/sxzz/vue-functional-ref/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sxzz%2Fvue-functional-ref/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002970,"owners_count":26083489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-03T10:41:05.756Z","updated_at":"2025-10-10T06:38:13.840Z","avatar_url":"https://github.com/sxzz.png","language":"TypeScript","funding_links":["https://github.com/sponsors/sxzz"],"categories":["TypeScript"],"sub_categories":[],"readme":"# vue-functional-ref\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![Unit Test][unit-test-src]][unit-test-href]\n\nFunctional-style refs for Vue. Inspired by [@antfu](https://github.com/antfu).\n\nRequires Vue 3.5+\n\n## Features\n\n- ✨ Extend refs with functional style.\n- 💖 Compatible with existing libraries. Tested on [Element Plus](https://github.com/element-plus/element-plus) and [VueUse](https://github.com/vueuse/vueuse).\n- 🦾 Full TypeScript support.\n- ⚡️ Supports Vite, Rollup, esbuild.\n\n## Install\n\n### PNPM / Yarn (Recommended)\n\nIf you're using pnpm or Yarn, try this approach first!\n\n```bash\npnpm i vue-functional-ref\n```\n\n```jsonc\n// package.json\n{\n  // ...\n  \"resolutions\": {\n    \"@vue/runtime-core\u003e@vue/reactivity\": \"npm:vue-functional-ref\",\n  },\n}\n```\n\n### Bundler\n\nIf you're not using pnpm but using Rollup, Vite or esbuild, try this approach.\n\n```bash\nnpm i vue-functional-ref\n```\n\nSupports Vite, Rollup and esbuild.\n\n```ts\nimport VueFunctionalRef from 'vue-functional-ref/vite'\n//                   Rollup: 'vue-functional-ref/rollup'\n//                  esbuild: 'vue-functional-ref/esbuild'\n\nexport default {\n  plugins: [VueFunctionalRef()],\n}\n```\n\n#### TypeScript Support\n\n```jsonc\n// tsconfig.json\n{\n  \"compilerOptions\": {\n    // ...\n    \"paths\": {\n      \"@vue/reactivity\": [\"./node_modules/vue-functional-ref/types\"],\n    },\n  },\n}\n```\n\n## Usage\n\n### Ref\n\n```ts\nimport { ref } from 'vue'\n\nconst count = ref(1)\ncount.set(10)\nconsole.log(count())\n\n// Mutate value inside of object\nconst obj = ref({ count: 1 })\nobj.mutate((obj) =\u003e obj.count++)\n```\n\n### Computed\n\n```ts\nimport { computed, ref } from 'vue'\n\nconst count = ref(1)\nconst double = computed(() =\u003e count() * 2)\n\nconsole.log(double() === 2) // true\nconsole.log(double.set === undefined) // true\n```\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg\"\u003e\n    \u003cimg src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\n[MIT](./LICENSE) License © 2022-PRESENT [Kevin Deng](https://github.com/sxzz)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/vue-functional-ref.svg\n[npm-version-href]: https://npmjs.com/package/vue-functional-ref\n[npm-downloads-src]: https://img.shields.io/npm/dm/vue-functional-ref\n[npm-downloads-href]: https://www.npmcharts.com/compare/vue-functional-ref?interval=30\n[unit-test-src]: https://github.com/sxzz/vue-functional-ref/actions/workflows/unit-test.yml/badge.svg\n[unit-test-href]: https://github.com/sxzz/vue-functional-ref/actions/workflows/unit-test.yml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxzz%2Fvue-functional-ref","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsxzz%2Fvue-functional-ref","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsxzz%2Fvue-functional-ref/lists"}