# vue-meteor-data

> Easy subscriptions and reactive queries for Vue and Meteor

Latest version **1.0.6** (published 2016-05-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-meteor-data
pnpm add vue-meteor-data
yarn add vue-meteor-data
bun add vue-meteor-data
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2016-05-16 |
| First published | 2015-09-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Jakob Rosenberg |
| Maintainers | jakobrosenberg |
| Keywords | vue, meteor, reactivity, subscriptions, collections |

## Links

- npm: https://www.npmjs.com/package/vue-meteor-data
- Repository: https://github.com/Grottolabs/vue-meteor-data
- Homepage: https://github.com/Grottolabs/vue-meteor-data#readme
- Issues: https://github.com/Grottolabs/vue-meteor-data/issues
- npm.io page: https://npm.io/package/vue-meteor-data

## Recent versions

- 1.0.6 (latest) — 2016-05-16
- 1.0.5 — 2016-01-08
- 1.0.4 — 2015-12-17
- 1.0.3 — 2015-12-17
- 1.0.2 — 2015-09-26
- 1.0.1 — 2015-09-25
- 1.0.0 — 2015-09-25

## README

#Vue Meteor Data

##Easy subscriptions and reactive queries for Vue and Meteor

When a view is created, the mixin iterates through your reactive data and wraps it individually in Vue's vm.$watch. Then each of these wrappers are wrapped in Meteor's Tracker.autorun.


####Installation
```javascript
var VueMeteorData = require ('vue-meteor-data')
Vue.mixin(VueMeteorData)      
```
 
 
####Usage example 1
```javascript
module.exports = {  
    reactiveData   : {
        tasks: function () {
            return Tasks.find().fetch()
        }
    },
    created: function(){
        this.subscribe('tasks/all')
    }
}    
```


####Usage example 2
```javascript    
module.exports = {
    created: function(){
        this.subscribe('tasks/all')
        this.autorun(function(){
            this.$set('tasks', Tasks.find().fetch())
        }.bind(this))
    }
}
```
 
 
####Usage example 3 with VueRouter
```javascript
module.exports = {  
    reactiveData   : {
        tasks: function () {
            return Tasks.find(this.$route.params.id).fetch()
        }
    },
    created: function(){
        this.subscribe('tasks/all')
    }
}
```


####Usage example 4
```javascript
module.exports = {  
    reactiveData   : {
        tasks: function (vm) {
            console.log(vm === this) //returns true
        }
    }
}
```

---
_Source: https://npm.io/package/vue-meteor-data · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
