react-native-meteor
Advanced tools
Comparing version 1.0.0-beta10 to 1.0.0-beta11
{ | ||
"name": "react-native-meteor", | ||
"version": "1.0.0-beta10", | ||
"version": "1.0.0-beta11", | ||
"description": "DDP React-native Client", | ||
@@ -32,3 +32,2 @@ "main": "src/Meteor.js", | ||
"react-mixin": "^3.0.3", | ||
"meteor-random": "0.0.3", | ||
"trackr": "^2.0.2", | ||
@@ -35,0 +34,0 @@ "wolfy87-eventemitter": "^4.3.0" |
@@ -15,3 +15,3 @@ [](https://badge.fury.io/gh/inProgress-team%2Freact-native-meteor) | ||
Meteor-like methods for React Native. **Currently in v1.0.0-beta9** ! 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-beta11** ! For old docs, see [v0.6.2 documentation](https://github.com/inProgress-team/react-native-meteor/tree/0.6.2) (classic ddp interface). | ||
@@ -117,3 +117,2 @@ ## What is it for ? | ||
* [.findOne(selector, options)](http://docs.meteor.com/#/full/findone) | ||
* [.findOne(id)](http://docs.meteor.com/#/full/findone) | ||
* [Meteor.user()](http://docs.meteor.com/#/full/meteor_user) | ||
@@ -124,2 +123,10 @@ * [Meteor.userId()](http://docs.meteor.com/#/full/meteor_userid) | ||
# Additionals collection methods | ||
* Meteor.collection(collectionName) | ||
* [.insert(doc, callback)](http://docs.meteor.com/#/full/insert) | ||
* [.update(id, modifier, [options], [callback])](http://docs.meteor.com/#/full/update) (not implemented yet) | ||
* [.upsert(id, modifier, [options], [callback])](http://docs.meteor.com/#/full/upsert) (not implemented yet) | ||
* [.remove(id, callback(err, countRemoved))](http://docs.meteor.com/#/full/remove) | ||
# MeteorListView Component | ||
@@ -180,3 +187,4 @@ | ||
- [ ] [Helper for Meteor-CollectionFS](https://github.com/inProgress-team/react-native-meteor/issues/18) | ||
- [ ] [Connection status unreliable](https://github.com/inProgress-team/react-native-meteor/issues/16) | ||
Pull Requests are welcome ! :) |
@@ -11,2 +11,3 @@ import { NetInfo } from 'react-native'; | ||
import ListView from './ListView'; | ||
import collection from './Collection'; | ||
@@ -16,39 +17,6 @@ | ||
MeteorListView: ListView, | ||
collection: collection, | ||
connectMeteor(reactClass) { | ||
return reactMixin.onClass(reactClass, Mixin); | ||
}, | ||
collection(name) { | ||
const Meteor = this; | ||
return { | ||
find(selector, options) { | ||
if(!Data.db || !Data.db[name]) return []; | ||
if(typeof selector == 'string') return this.find({_id: selector}, options); | ||
return Data.db[name].find(selector, options) | ||
}, | ||
findOne(selector, options) { | ||
if(!Data.db || !Data.db[name]) return null; | ||
if(typeof selector == 'string') return this.findOne({_id: selector}, options); | ||
return Data.db[name] && Data.db[name].findOne(selector, options) | ||
}, | ||
insert(item, callback) { | ||
return; | ||
if(!Data.db[name]) { Data.db.addCollection(name) } | ||
const itemSaved = Data.db[name].upsert({...item}); | ||
console.log('/'+name+'/insert'); | ||
Meteor.call('/'+name+'/insert', itemSaved, (err, res) => { | ||
if(err) return console.log(err); | ||
console.log(res); | ||
}); | ||
return ; | ||
} | ||
}; | ||
}, | ||
...User, | ||
@@ -55,0 +23,0 @@ status() { |
31486
5
17
685
187
- Removedmeteor-random@0.0.3
- Removedcrypto@0.0.3(transitive)
- Removedmeteor-random@0.0.3(transitive)