{"id":17651309,"url":"https://github.com/raiondesu/vuse-rx","last_synced_at":"2025-10-18T20:02:35.061Z","repository":{"id":40782611,"uuid":"334743806","full_name":"Raiondesu/vuse-rx","owner":"Raiondesu","description":"Vue 3 + rxjs = ❤","archived":false,"fork":false,"pushed_at":"2023-01-22T21:05:17.000Z","size":6344,"stargazers_count":60,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T06:12:49.063Z","etag":null,"topics":["composition-api","reactive","reactive-programming","rx","rxjs","state","state-management","typescript","vue","vue-next","vue3"],"latest_commit_sha":null,"homepage":"https://vuse-rx.raiondesu.dev","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/Raiondesu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-31T19:54:38.000Z","updated_at":"2025-01-16T08:43:55.000Z","dependencies_parsed_at":"2023-02-12T18:15:34.334Z","dependency_job_id":null,"html_url":"https://github.com/Raiondesu/vuse-rx","commit_stats":null,"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raiondesu%2Fvuse-rx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raiondesu%2Fvuse-rx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raiondesu%2Fvuse-rx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raiondesu%2Fvuse-rx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Raiondesu","download_url":"https://codeload.github.com/Raiondesu/vuse-rx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016638,"owners_count":21198833,"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","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":["composition-api","reactive","reactive-programming","rx","rxjs","state","state-management","typescript","vue","vue-next","vue3"],"created_at":"2024-10-23T11:40:49.219Z","updated_at":"2025-10-18T20:02:34.980Z","avatar_url":"https://github.com/Raiondesu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\" style=\"text-align: center\"\u003e\n  \u003ca href=\"https://vuse-rx.raiondesu.dev\"\u003e\u003cimg src=\"docs/public/logo-g.svg\"/\u003e\u003c/a\u003e\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\" style=\"text-align: center\"\u003eComplete first-class RxJS 7+ support for Vue 3\u003c/h3\u003e\n\u003cp align=\"center\" style=\"text-align: center\"\u003e\n  \u003ca href=\"https://github.com/Raiondesu/vuse-rx/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/raiondesu/vuse-rx/publish.yml?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.com/vuse-rx\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/vuse-rx?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://bundlephobia.com/result?p=vuse-rx\"\u003e\u003cimg src=\"https://img.shields.io/bundlephobia/minzip/vuse-rx?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.com/vuse-rx\"\u003e\u003cimg src=\"https://img.shields.io/npm/dt/vuse-rx?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/Raiondesu/vuse-rx\"\u003e\u003cimg src=\"https://img.shields.io/coveralls/github/Raiondesu/vuse-rx?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://vuse-rx.raiondesu.dev\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-stable-blue?style=flat-square\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://next.vuse-rx.raiondesu.dev\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-beta-green?style=flat-square\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What is this?\n\n`vuse-rx` is a bridge between Vue 3 and RxJS:\nit connects reactive states and refs with observables and subjects\nin a way that enforces separation of concerns and drastically reduces the amount of boilerplate code.\n\nThe highlights are:\n- [`useRxState`](https://vuse-rx.raiondesu.dev/api/use-rx-state) - flux-like state management with observables;\n- [`syncRef`](https://vuse-rx.raiondesu.dev/api/refs#syncref) - synchronize two refs with either one-way or two-way binding;\n- [`fromRef`](https://vuse-rx.raiondesu.dev/api/refs#fromref) - create an observable from any ref or watch source;\n- [`refFrom`](https://vuse-rx.raiondesu.dev/api/refs#reffrom) - create a ref from a promise/observable/iterable/generator or anything else;\n\n### See the [docs](https://vuse-rx.raiondesu.dev) for more information\n\n## Install\n\n`npm i -S vuse-rx`\n\n`yard add vuse-rx`\n\n## Use\n\nBelow is a simple example of a counter component with a state and two simple reducers.\nSee the docs for a [more detailed and interactive example](https://vuse-rx.raiondesu.dev/recipes/counter).\n\n```vue\n\u003cscript lang=\"ts\"\u003e\nimport { useRxState, syncRef } from 'vuse-rx';\nimport { defineComponent, toRef } from 'vue';\nimport { tap } from 'rxjs/operators';\n\nexport default defineComponent({\n  setup() {\n    const {\n      actions: {\n        increment,\n        setCount\n      },\n      state,\n      state$ // state observable\n    } = useRxState({ count: 0 })({\n      // stateful reducer with mutation context\n      increment: () =\u003e (state, mutation) =\u003e ({\n        // automatic type inference for the state\n        count: state.count + 1\n      }),\n\n      // stateless reducer\n      setCount: (count: string) =\u003e ({\n        // custom business logic\n        count: isNaN(Number(count)) ? 0 : Number(count)\n      }),\n    }, state$ =\u003e state$.pipe(tap(state =\u003e console.log('state is updated', state))));\n\n    // \"Activating\" the actions\n    state$.subscribe(state =\u003e console.log('counter: ', state.count));\n\n    return {\n      increment,\n      setCount,\n      state,\n\n      // One-way data binding from reactive state (with type convertation)\n      countRef: syncRef(toRef(state, 'count'), { to: String }),\n    };\n  }\n});\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cp\u003eCounter: {{ state.count }}\u003c/p\u003e\n  \u003cbutton @click=\"increment\"\u003eincrement\u003c/button\u003e\n  \u003cinput v-model=\"countRef\" @keyup.enter=\"setCount(countRef)\"/\u003e\n\u003c/template\u003e\n```\n\n## Contributing\n\nPull requests and stars are always welcome. ❤\\\nFor bugs and feature requests, [please create an issue](https://github.com/Raiondesu/vuse-rx/issues/new).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraiondesu%2Fvuse-rx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraiondesu%2Fvuse-rx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraiondesu%2Fvuse-rx/lists"}