@vueuse/rxjs
Enables RxJS reactive functions in Vue
927,704
22,398
| Install | |
|---|---|
npm install @vueuse/rxjs |
|
| Latest Version: | 15.0.0 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 27, 2026 |
| Links: | GitHub · npm |
Maintainer: vueuse-bot
@vueuse/rxjs
This is an add-on of VueUse, enabling a natural way of using RxJS.
Install
npm i @vueuse/rxjs rxjs
Functions
from— wrappers around RxJS'sfrom()andfromEvent()to allow them to acceptrefstoObserver— sugar function to convert arefinto an RxJS ObserveruseExtractedObservable— use an RxJSObservableas extracted from one or more composablesuseObservable— use an RxJSObservableuseSubject— bind an RxJSSubjectto arefand propagate value changes both waysuseSubscription— use an RxJSSubscriptionwithout worrying about unsubscribing from it or creating memory leakswatchExtractedObservable— watch the values of an RxJSObservableas extracted from one or more composables
Example
import { from, fromEvent, useObservable } from '@vueuse/rxjs'
import { forkJoin, of } from 'rxjs'
import { ajax } from 'rxjs/ajax'
import { concatAll, map, mergeMap, pluck, scan, take } from 'rxjs/operators'
import { useTemplateRef } from 'vue'
const BASE_URL = 'https://jsonplaceholder.typicode.com'
const button = useTemplateRef('buttonRef')
const posts = useObservable(
fromEvent(button, 'click').pipe(
mergeMap(() => ajax.getJSON(`${BASE_URL}/posts`).pipe(
concatAll(),
take(4),
mergeMap(({ id, userId, title }) => forkJoin({
id: of(id),
comments: ajax.getJSON(`${BASE_URL}/posts/${id}/comments`).pipe(
map(comments => comments.length),
),
username: ajax.getJSON(`${BASE_URL}/users/${userId}`).pipe(
pluck('username'),
),
}), 2),
scan((acc, curr) => [...acc, curr], []),
)),
),
)
License
MIT License © 2019-PRESENT Anthony Fu
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 15.0.0 | ^3.5.0 | MIT | |
| 14.4.0 | ^3.5.0 | MIT | |
| 14.3.0 | ^3.5.0 | MIT | |
| 14.2.1 | ^3.5.0 | MIT | |
| 14.2.0 | ^3.5.0 | MIT | |
| 14.1.0 | ^3.5.0 | MIT | |
| 14.0.0 | ^3.5.0 | MIT | |
| 13.9.0 | ^3.5.0 | MIT | |
| 13.8.0 | ^3.5.0 | MIT | |
| 13.7.0 | ^3.5.0 | MIT | |
| 13.6.0 | ^3.5.0 | MIT | |
| 13.5.0 | ^3.5.0 | MIT | |
| 13.4.0 | ^3.5.0 | MIT | |
| 13.3.0 | ^3.5.0 | MIT | |
| 13.2.0 | ^3.5.0 | MIT | |
| 13.1.0 | ^3.5.0 | MIT | |
| 13.0.0 | ^3.5.0 | MIT | |
| 12.8.2 | ^3.5.13 | MIT | |
| 12.8.1 | ^3.5.13 | MIT | |
| 12.8.0 | ^3.5.13 | MIT | |
| 12.7.0 | ^3.5.13 | MIT | |
| 12.6.1 | ^3.5.13 | MIT | |
| 12.6.0 | ^3.5.13 | MIT | |
| 12.5.0 | ^3.5.13 | MIT | |
| 12.4.0 | ^3.5.13 | MIT | |
| 12.3.0 | ^3.5.13 | MIT | |
| 12.2.0 | ^3.5.13 | MIT | |
| 12.1.0 | ^3.5.13 | MIT | |
| 12.0.0 | ^3.5.13 | MIT | |
| 11.3.0 | MIT |
Showing the latest 30 of 216. See every release on npm
Pre-releases (68)
| Version | Released | Vue | License |
|---|---|---|---|
| 14.0.0-beta.1 | ^3.5.0 | MIT | |
| 14.0.0-alpha.3 | ^3.5.0 | MIT | |
| 14.0.0-alpha.2 | ^3.5.0 | MIT | |
| 14.0.0-alpha.1 | ^3.5.0 | MIT | |
| 14.0.0-alpha.0 | ^3.5.0 | MIT | |
| 13.0.0-beta.2 | ^3.5.13 | MIT | |
| 13.0.0-beta.1 | ^3.5.13 | MIT | |
| 12.2.0-beta.4 | ^3.5.13 | MIT | |
| 12.2.0-beta.3 | ^3.5.13 | MIT | |
| 12.0.0-beta.1 | ^3.5.13 | MIT | |
| 11.0.0-beta.3 | MIT | ||
| 11.0.0-beta.2 | MIT | ||
| 11.0.0-beta.1 | MIT | ||
| 10.0.0-beta.5 | MIT | ||
| 10.0.0-beta.4 | MIT | ||
| 10.0.0-beta.3 | MIT | ||
| 10.0.0-beta.2 | MIT | ||
| 10.0.0-beta.1 | MIT | ||
| 10.0.0-beta.0 | MIT | ||
| 9.0.0-beta.2 | MIT | ||
| 9.0.0-beta.1 | MIT | ||
| 9.0.0-beta.0 | MIT | ||
| 8.0.0-beta.3 | MIT | ||
| 8.0.0-beta.2 | MIT | ||
| 6.0.0-beta.3 | MIT | ||
| 6.0.0-beta.2 | MIT | ||
| 6.0.0-beta.1 | MIT | ||
| 5.0.0-beta.8 | MIT | ||
| 5.0.0-beta.7 | MIT | ||
| 5.0.0-beta.3 | MIT |
Showing the latest 30 of 68. See every release on npm