Skip to content

Commit

Permalink
Restart subscriptions when reconneted to ddp server
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo mathieu committed Mar 15, 2016
1 parent bd9b613 commit 1e961fe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 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-beta11** ! 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-beta12** ! 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
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-beta11",
"version": "1.0.0-beta12",
"description": "DDP React-native Client",
"main": "src/Meteor.js",
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions src/Meteor.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ module.exports = {
this.connect(Data._endpoint, Data._options);
}
},
_subscriptionsRestart() {
for(var i in Data.subscriptions) {
const sub = Data.subscriptions[i];
sub.references = Data.ddp.sub(sub.name, sub.params);
}
},
connect(endpoint, options) {
Data._endpoint = endpoint;
Data._options = options;
Expand All @@ -65,6 +71,7 @@ module.exports = {
Data.ddp.on("connected", ()=>{
console.info("Connected to DDP server.");
this._loadInitialUser();
this._subscriptionsRestart();


if(!this._netInfoListener) {
Expand Down

0 comments on commit 1e961fe

Please sign in to comment.