
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Simple RxJS binding for Vue.js.
With global scripts: just make sure to include vue-rx.js
after Vue.js and RxJS. It will be installed automatically.
With NPM:
var Vue = require('vue')
var Rx = require('rx')
var VueRx = require('vue-rx')
// tada!
Vue.use(VueRx, Rx)
// The second argument is optional if you are not using RxJS but other generic observable implementations:
Vue.use(VueRx)
With NPM:
var Vue = require('vue')
var Rx = require('rx')
var VueRx = require('vue-rx')
// tada!
Vue.use(VueRx, Rx)
// provide Rx observables with the `subscriptions` option
new Vue({
el: '#app',
subscriptions: {
msg: messageObservable
}
})
<!-- bind to it normally in templates -->
<div>{{ msg }}</div>
The subscriptions
options can also take a function so that you can return unique observables for each component instance:
Vue.component('foo', {
subscriptions: function () {
return {
msg: Rx.Observable.create(...)
}
}
})
You can use this plugin with other observable implementations, as long as it implements the .subscribe
and .dispose / .unsubscribe
interface. For example, you can use it with most.js
or Falcor streams.
$watchAsObservable
This feature requires using RxJS.
This is a prototype method added to instances. You can use it to create an observable from a value watcher:
created:function () {
this.$watchAsObservable('a')
.subscribe(function (val) {
console.log('stream value', val)
},function (err) {
console.error(err)
},function () {
console.log('complete')
})
}
See /example
for a simple example.
FAQs
RxJS bindings for Vue
The npm package vue-rx receives a total of 6,316 weekly downloads. As such, vue-rx popularity was classified as popular.
We found that vue-rx demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.