vue-route-rx

1.0.1 • Public • Published

vue-route-rx

Create observable from vue-router to work with vue-rx subscriptions

Installation

NPM + ES2015

npm install vue vue-router vue-rx rxjs vue-route-rx --save
import Vue from 'vue'
import VueRouter from 'vue-router'
import { Observable, Subscription, BehaviorSubject } from 'rxjs'
import VueRx from 'vue-rx'
import VueRouteRx from 'vue-route-rx'
 
Vue.use(VueRouter)
Vue.use(VueRx, { Observable, Subscription })
Vue.use(VueRouteRx, { BehaviorSubject })
 
const router = new VueRouter(...)
VueRouteRx.use(router)

Global Script

Includes vue-route-rx after Vue.js and RxJS

Usage

Vue.component('foo', {
  subscriptions () {
    return {
      msg: this.$$route
        .flatMap((route) => Message.get(route.params.id))
    }
  }
})

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.15latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.15
1.0.00

Package Sidebar

Install

npm i vue-route-rx

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • acoshift