Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Call onStart before Meteor.subscribe() which ensures it's called befo…
…re onReady
  • Loading branch information
SimonSimCity committed Oct 22, 2019
commit 706b00586cc2ce810e02aef003a0d401c5e44ba0
9 changes: 4 additions & 5 deletions dist/angular-meteor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1969,10 +1969,12 @@ return /******/ (function(modules) { // webpackBootstrap
throw Error('reactive function\'s return value must be an array');
}

var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb]));

result.isLoading = true;
result.error = null;
onStartIterator += 1;
hooks.onStart();

var subscription = (_Meteor = Meteor).subscribe.apply(_Meteor, [subName].concat(_toConsumableArray(args), [cb]));

Tracker.autorun(function () {
// Subscribe to changes on the ready-property by calling the ready-method.
Expand All @@ -1982,9 +1984,6 @@ return /******/ (function(modules) { // webpackBootstrap
_this.$$throttledDigest();
});

onStartIterator += 1;
hooks.onStart();

result.ready = subscription.ready.bind(subscription);
result.subscriptionId = subscription.subscriptionId;
});
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-meteor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/angular-meteor.min.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/modules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ angular.module(name, [
throw Error(`reactive function's return value must be an array`);
}

const subscription = Meteor.subscribe(subName, ...args, cb);

result.isLoading = true;
result.error = null;
onStartIterator += 1;
hooks.onStart();

const subscription = Meteor.subscribe(subName, ...args, cb);

Tracker.autorun(() => {
// Subscribe to changes on the ready-property by calling the ready-method.
Expand All @@ -119,9 +121,6 @@ angular.module(name, [
this.$$throttledDigest();
});

onStartIterator += 1;
hooks.onStart();

result.ready = subscription.ready.bind(subscription);
result.subscriptionId = subscription.subscriptionId;
});
Expand Down