Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo mathieu committed Mar 8, 2016
1 parent 00cabb8 commit 51a9c62
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
21 changes: 8 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# react-native-meteor

Meteor-like methods for React Native. **Currently in v1.0.0-beta3** ! For old docs, see [v0.6.2 documentation](https://github.com/inProgress-team/react-native-meteor/tree/0.6.2) (classic ddp interface).
Meteor-like methods for React Native. **Currently in v1.0.0-beta4** ! For old docs, see [v0.6.2 documentation](https://github.com/inProgress-team/react-native-meteor/tree/0.6.2) (classic ddp interface).

## What is it for ?

Expand Down Expand Up @@ -86,23 +86,17 @@ Inside this method, you can create subscriptions (see below) when component is m

your server side:
```javascript
Meteor.publish('todos', function(selector, options){
var selector = selector || {};
var options = options || {};
return Todos.find(selector, options);
Meteor.publish('todos', function(done, options){
return Todos.find({ done: done }, options);
});
```

your react-native client code:
```javascript
//Meteor subscribe can be used like on meteor official site
Meteor.subscribe('todos', {status: 'done'}, {limit: 10, sort: {createdAt: -1}});
Meteor.subscribe('todos', true, {limit: 10, sort: {createdAt: -1}});
```

##### NOTE
- Meteor subscribe parameter still not supporting EJSON, so you can't pass param value like date, boolean etc. For now it's only support object of string (JSON)
- Meteor subscribe parameter already support Publish Composite. If you are using this package, related published collections will be available too in subscriptions.


## getMeteorData

Expand Down Expand Up @@ -133,16 +127,17 @@ Connect to a DDP server. You only have to do this once in your app.
* [Meteor.logout](http://docs.meteor.com/#/full/meteor_logout)
* [Meteor.call](http://docs.meteor.com/#/full/meteor_call)

##### NOTE
Meteor call parameter still not supporting EJSON, so you can't pass param value like date, boolean etc. For now it's only support object of string (JSON)

## Meteor.ddp

Once connected to the ddp server, you can access every method available in [ddp.js](https://github.com/mondora/ddp.js/).
* Meteor.ddp.on('connected')
* Meteor.ddp.on('added')
* Meteor.ddp.on('changed')
* ...

# TODO

- [ ] [EJSON parameter support](https://github.com/inProgress-team/react-native-meteor/issues/7)
- [ ] [EJSON parameters support in subscribe and call](https://github.com/inProgress-team/react-native-meteor/issues/7)

Pull Requests are welcome ! :)
4 changes: 1 addition & 3 deletions example/mobile/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export default class App extends Component {
Meteor.ddp.on('connected', function() {
console.log('CONNECTED');
});
Meteor.ddp.on('added', function(message) {
console.log(message);
});

}
render() {
return (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-meteor",
"version": "1.0.0-beta3",
"version": "1.0.0-beta4",
"description": "DDP React-native Client",
"main": "src/Meteor.js",
"scripts": {
Expand Down

0 comments on commit 51a9c62

Please sign in to comment.