An open API service indexing awesome lists of open source software.

https://github.com/crapthings/meteor-data-container

this container let your write less code
https://github.com/crapthings/meteor-data-container

Last synced: about 1 year ago
JSON representation

this container let your write less code

Awesome Lists containing this project

README

          

## Installation

meteor npm i lodash react-komposer --save

meteor add crapthings:meteor-data-container

## Usage

> publish your `posts` and return your posts cursor

```
Meteor.publish('posts', function (userId) {
const selector = userId ? { userId } : {}
return Posts.find(selector)
})
```

> use `MeteorDataContainer` to get your `reactive` data

```

const subscriptions = {
posts: []
}

const data = {
posts () {
return Posts.find().fetch()
{
}

const PostsListComponent = () =>


{posts.map(post) =>

{post.title}

}
} />

```

> "subscriptions" is an object. each of keys in subscriptions is the subscribe name, and value should be an array that apply as publish args

> "data" is an object, each of keys can be use in container under props