Skip to content

v2.0.0

Compare
Choose a tag to compare
@yyx990803 yyx990803 released this 05 Nov 16:25
· 113 commits to master since this release

Breaking Changes

  • Instead of using observables in data, a new option subscriptions should be used. The option accepts either an object or a function that returns an object:

    new Vue({
      subscriptions: {
        msg: messageObservable
      }
    })

New

Compatibility with Generic Observables

You can now 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')
    })
}