mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Correct accidental use of Array.prototype.every on an Object.
Fixes the error reported in the 1.6.1 pull request. (Thanks, @yorrd!) It's worth nothing that the `DDP._allSubscriptionsReady` function which was broken is used by the deprecated `spiderable` package. Since `spiderable` is deprecated, it's advisable to look into ways to stop depending on it. Refs: https://github.com/meteor/meteor/pull/9274#issuecomment-345358178.
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
import { DDPCommon } from 'meteor/ddp-common';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { keys } from "meteor/ddp-common/utils.js";
|
||||
|
||||
import { Connection } from './livedata_connection.js';
|
||||
|
||||
// This array allows the `_allSubscriptionsReady` method below, which
|
||||
// is used by the `spiderable` package, to keep track of whether all
|
||||
// data is ready.
|
||||
const allConnections = [];
|
||||
|
||||
/**
|
||||
* @namespace DDP
|
||||
* @summary Namespace for DDP-related methods/classes.
|
||||
@@ -78,11 +84,10 @@ DDP.onReconnect = callback => {
|
||||
// Hack for `spiderable` package: a way to see if the page is done
|
||||
// loading all the data it needs.
|
||||
//
|
||||
allConnections = [];
|
||||
DDP._allSubscriptionsReady = () => {
|
||||
return allConnections.every(conn => {
|
||||
return conn._subscriptions.every(sub => {
|
||||
return sub.ready;
|
||||
return keys(conn._subscriptions).every(id => {
|
||||
return conn._subscriptions[id].ready;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user