diff --git a/README.md b/README.md index 19c70a6..b36a707 100644 --- a/README.md +++ b/README.md @@ -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 ? @@ -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 @@ -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 ! :) diff --git a/example/mobile/app/App.js b/example/mobile/app/App.js index ae7e3d1..d4ea22b 100644 --- a/example/mobile/app/App.js +++ b/example/mobile/app/App.js @@ -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 ( diff --git a/package.json b/package.json index 58df50b..d73e48b 100644 --- a/package.json +++ b/package.json @@ -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": {