parse 5.1.0-alpha.3 → 5.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/parse.js +94 -65
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +94 -65
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/LiveQueryClient.js +42 -32
- package/lib/browser/LiveQuerySubscription.js +15 -5
- package/lib/browser/ParseLiveQuery.js +32 -23
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/LiveQueryClient.js +2 -2
- package/lib/node/LiveQuerySubscription.js +2 -2
- package/lib/node/ParseLiveQuery.js +2 -3
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +28 -19
- package/lib/react-native/LiveQuerySubscription.js +14 -5
- package/lib/react-native/ParseLiveQuery.js +11 -2
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/LiveQueryClient.js +42 -32
- package/lib/weapp/LiveQuerySubscription.js +15 -5
- package/lib/weapp/ParseLiveQuery.js +32 -23
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
13
13
|
exports.default = void 0;
|
|
14
14
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
15
15
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/map"));
|
|
16
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
16
17
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
|
|
17
18
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/json/stringify"));
|
|
18
19
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
|
|
@@ -79,10 +80,10 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
function _unsupportedIterableToArray(o, minLen) {
|
|
82
|
-
var
|
|
83
|
+
var _context7;
|
|
83
84
|
if (!o) return;
|
|
84
85
|
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
85
|
-
var n = _sliceInstanceProperty(
|
|
86
|
+
var n = _sliceInstanceProperty(_context7 = Object.prototype.toString.call(o)).call(_context7, 8, -1);
|
|
86
87
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
87
88
|
if (n === "Map" || n === "Set") return _Array$from(o);
|
|
88
89
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
@@ -199,6 +200,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
199
200
|
* @param {string} options.installationId (optional)
|
|
200
201
|
*/
|
|
201
202
|
function LiveQueryClient(_ref) {
|
|
203
|
+
var _this = this;
|
|
202
204
|
var applicationId = _ref.applicationId,
|
|
203
205
|
serverURL = _ref.serverURL,
|
|
204
206
|
javascriptKey = _ref.javascriptKey,
|
|
@@ -239,8 +241,16 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
239
241
|
this.state = CLIENT_STATE.INITIALIZED;
|
|
240
242
|
var EventEmitter = _CoreManager.default.getEventEmitter();
|
|
241
243
|
this.emitter = new EventEmitter();
|
|
242
|
-
this.on =
|
|
243
|
-
|
|
244
|
+
this.on = function (eventName, listener) {
|
|
245
|
+
return _this.emitter.on(eventName, listener);
|
|
246
|
+
};
|
|
247
|
+
this.emit = function (eventName) {
|
|
248
|
+
var _this$emitter, _context;
|
|
249
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
250
|
+
args[_key - 1] = arguments[_key];
|
|
251
|
+
}
|
|
252
|
+
return (_this$emitter = _this.emitter).emit.apply(_this$emitter, (0, _concat.default)(_context = [eventName]).call(_context, args));
|
|
253
|
+
};
|
|
244
254
|
// adding listener so process does not crash
|
|
245
255
|
// best practice is for developer to register their own listener
|
|
246
256
|
this.on('error', function () {});
|
|
@@ -270,7 +280,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
270
280
|
value: function (query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
|
|
271
281
|
var _queryJSON$keys,
|
|
272
282
|
_queryJSON$watch,
|
|
273
|
-
|
|
283
|
+
_this2 = this;
|
|
274
284
|
if (!query) {
|
|
275
285
|
return;
|
|
276
286
|
}
|
|
@@ -296,7 +306,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
296
306
|
this.subscriptions.set(this.requestId, subscription);
|
|
297
307
|
this.requestId += 1;
|
|
298
308
|
this.connectPromise.then(function () {
|
|
299
|
-
|
|
309
|
+
_this2.socket.send((0, _stringify.default)(subscribeRequest));
|
|
300
310
|
}).catch(function (error) {
|
|
301
311
|
subscription.subscribePromise.reject(error);
|
|
302
312
|
});
|
|
@@ -312,7 +322,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
312
322
|
}, {
|
|
313
323
|
key: "unsubscribe",
|
|
314
324
|
value: function (subscription /*: Object*/) /*: ?Promise*/{
|
|
315
|
-
var
|
|
325
|
+
var _this3 = this;
|
|
316
326
|
if (!subscription) {
|
|
317
327
|
return;
|
|
318
328
|
}
|
|
@@ -321,7 +331,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
321
331
|
requestId: subscription.id
|
|
322
332
|
};
|
|
323
333
|
return this.connectPromise.then(function () {
|
|
324
|
-
return
|
|
334
|
+
return _this3.socket.send((0, _stringify.default)(unsubscribeRequest));
|
|
325
335
|
}).then(function () {
|
|
326
336
|
return subscription.unsubscribePromise;
|
|
327
337
|
});
|
|
@@ -335,7 +345,7 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
335
345
|
}, {
|
|
336
346
|
key: "open",
|
|
337
347
|
value: function () {
|
|
338
|
-
var
|
|
348
|
+
var _this4 = this;
|
|
339
349
|
var WebSocketImplementation = _CoreManager.default.getWebSocketController();
|
|
340
350
|
if (!WebSocketImplementation) {
|
|
341
351
|
this.emit(CLIENT_EMMITER_TYPES.ERROR, 'Can not find WebSocket implementation');
|
|
@@ -349,25 +359,25 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
349
359
|
|
|
350
360
|
// Bind WebSocket callbacks
|
|
351
361
|
this.socket.onopen = function () {
|
|
352
|
-
|
|
362
|
+
_this4._handleWebSocketOpen();
|
|
353
363
|
};
|
|
354
364
|
this.socket.onmessage = function (event) {
|
|
355
|
-
|
|
365
|
+
_this4._handleWebSocketMessage(event);
|
|
356
366
|
};
|
|
357
367
|
this.socket.onclose = function (event) {
|
|
358
|
-
|
|
359
|
-
|
|
368
|
+
_this4.socket.closingPromise.resolve(event);
|
|
369
|
+
_this4._handleWebSocketClose();
|
|
360
370
|
};
|
|
361
371
|
this.socket.onerror = function (error) {
|
|
362
|
-
|
|
372
|
+
_this4._handleWebSocketError(error);
|
|
363
373
|
};
|
|
364
374
|
}
|
|
365
375
|
}, {
|
|
366
376
|
key: "resubscribe",
|
|
367
377
|
value: function () {
|
|
368
|
-
var
|
|
369
|
-
|
|
370
|
-
(0, _forEach.default)(
|
|
378
|
+
var _context2,
|
|
379
|
+
_this5 = this;
|
|
380
|
+
(0, _forEach.default)(_context2 = this.subscriptions).call(_context2, function (subscription, requestId) {
|
|
371
381
|
var query = subscription.query;
|
|
372
382
|
var queryJSON = query.toJSON();
|
|
373
383
|
var where = queryJSON.where;
|
|
@@ -386,8 +396,8 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
386
396
|
if (sessionToken) {
|
|
387
397
|
subscribeRequest.sessionToken = sessionToken;
|
|
388
398
|
}
|
|
389
|
-
|
|
390
|
-
|
|
399
|
+
_this5.connectPromise.then(function () {
|
|
400
|
+
_this5.socket.send((0, _stringify.default)(subscribeRequest));
|
|
391
401
|
});
|
|
392
402
|
});
|
|
393
403
|
}
|
|
@@ -401,14 +411,14 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
401
411
|
}, {
|
|
402
412
|
key: "close",
|
|
403
413
|
value: function () /*: ?Promise*/{
|
|
404
|
-
var _this$socket, _this$socket2,
|
|
414
|
+
var _this$socket, _this$socket2, _context3;
|
|
405
415
|
if (this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED) {
|
|
406
416
|
return;
|
|
407
417
|
}
|
|
408
418
|
this.state = CLIENT_STATE.DISCONNECTED;
|
|
409
419
|
(_this$socket = this.socket) === null || _this$socket === void 0 ? void 0 : _this$socket.close();
|
|
410
420
|
// Notify each subscription about the close
|
|
411
|
-
var _iterator = _createForOfIteratorHelper((0, _values.default)(
|
|
421
|
+
var _iterator = _createForOfIteratorHelper((0, _values.default)(_context3 = this.subscriptions).call(_context3)),
|
|
412
422
|
_step;
|
|
413
423
|
try {
|
|
414
424
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -555,14 +565,14 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
555
565
|
}, {
|
|
556
566
|
key: "_handleWebSocketClose",
|
|
557
567
|
value: function () {
|
|
558
|
-
var
|
|
568
|
+
var _context4;
|
|
559
569
|
if (this.state === CLIENT_STATE.DISCONNECTED) {
|
|
560
570
|
return;
|
|
561
571
|
}
|
|
562
572
|
this.state = CLIENT_STATE.CLOSED;
|
|
563
573
|
this.emit(CLIENT_EMMITER_TYPES.CLOSE);
|
|
564
574
|
// Notify each subscription about the close
|
|
565
|
-
var _iterator2 = _createForOfIteratorHelper((0, _values.default)(
|
|
575
|
+
var _iterator2 = _createForOfIteratorHelper((0, _values.default)(_context4 = this.subscriptions).call(_context4)),
|
|
566
576
|
_step2;
|
|
567
577
|
try {
|
|
568
578
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -579,9 +589,9 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
579
589
|
}, {
|
|
580
590
|
key: "_handleWebSocketError",
|
|
581
591
|
value: function (error /*: any*/) {
|
|
582
|
-
var
|
|
592
|
+
var _context5;
|
|
583
593
|
this.emit(CLIENT_EMMITER_TYPES.ERROR, error);
|
|
584
|
-
var _iterator3 = _createForOfIteratorHelper((0, _values.default)(
|
|
594
|
+
var _iterator3 = _createForOfIteratorHelper((0, _values.default)(_context5 = this.subscriptions).call(_context5)),
|
|
585
595
|
_step3;
|
|
586
596
|
try {
|
|
587
597
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
@@ -598,8 +608,8 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
598
608
|
}, {
|
|
599
609
|
key: "_handleReconnect",
|
|
600
610
|
value: function () {
|
|
601
|
-
var
|
|
602
|
-
|
|
611
|
+
var _context6,
|
|
612
|
+
_this6 = this;
|
|
603
613
|
// if closed or currently reconnecting we stop attempting to reconnect
|
|
604
614
|
if (this.state === CLIENT_STATE.DISCONNECTED) {
|
|
605
615
|
return;
|
|
@@ -615,11 +625,11 @@ var LiveQueryClient = /*#__PURE__*/function () {
|
|
|
615
625
|
if (this.reconnectHandle) {
|
|
616
626
|
clearTimeout(this.reconnectHandle);
|
|
617
627
|
}
|
|
618
|
-
this.reconnectHandle = (0, _setTimeout2.default)((0, _bind.default)(
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}).call(
|
|
628
|
+
this.reconnectHandle = (0, _setTimeout2.default)((0, _bind.default)(_context6 = function () {
|
|
629
|
+
_this6.attempts++;
|
|
630
|
+
_this6.connectPromise = (0, _promiseUtils.resolvingPromise)();
|
|
631
|
+
_this6.open();
|
|
632
|
+
}).call(_context6, this), time);
|
|
623
633
|
}
|
|
624
634
|
}]);
|
|
625
635
|
return LiveQueryClient;
|
|
@@ -6,6 +6,7 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
9
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
10
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
11
12
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
@@ -99,6 +100,7 @@ var Subscription = /*#__PURE__*/function () {
|
|
|
99
100
|
* @param {string} sessionToken - optional session token
|
|
100
101
|
*/
|
|
101
102
|
function Subscription(id, query, sessionToken) {
|
|
103
|
+
var _this = this;
|
|
102
104
|
(0, _classCallCheck2.default)(this, Subscription);
|
|
103
105
|
this.id = id;
|
|
104
106
|
this.query = query;
|
|
@@ -108,8 +110,16 @@ var Subscription = /*#__PURE__*/function () {
|
|
|
108
110
|
this.subscribed = false;
|
|
109
111
|
var EventEmitter = _CoreManager.default.getEventEmitter();
|
|
110
112
|
this.emitter = new EventEmitter();
|
|
111
|
-
this.on =
|
|
112
|
-
|
|
113
|
+
this.on = function (eventName, listener) {
|
|
114
|
+
return _this.emitter.on(eventName, listener);
|
|
115
|
+
};
|
|
116
|
+
this.emit = function (eventName) {
|
|
117
|
+
var _this$emitter, _context;
|
|
118
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
119
|
+
args[_key - 1] = arguments[_key];
|
|
120
|
+
}
|
|
121
|
+
return (_this$emitter = _this.emitter).emit.apply(_this$emitter, (0, _concat.default)(_context = [eventName]).call(_context, args));
|
|
122
|
+
};
|
|
113
123
|
// adding listener so process does not crash
|
|
114
124
|
// best practice is for developer to register their own listener
|
|
115
125
|
this.on('error', function () {});
|
|
@@ -123,10 +133,10 @@ var Subscription = /*#__PURE__*/function () {
|
|
|
123
133
|
(0, _createClass2.default)(Subscription, [{
|
|
124
134
|
key: "unsubscribe",
|
|
125
135
|
value: function () /*: Promise*/{
|
|
126
|
-
var
|
|
136
|
+
var _this2 = this;
|
|
127
137
|
return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient().then(function (liveQueryClient) {
|
|
128
|
-
|
|
129
|
-
return liveQueryClient.unsubscribe(
|
|
138
|
+
_this2.emit('close');
|
|
139
|
+
return liveQueryClient.unsubscribe(_this2);
|
|
130
140
|
});
|
|
131
141
|
}
|
|
132
142
|
}]);
|
|
@@ -6,9 +6,10 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
10
|
+
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
9
11
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
10
12
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of"));
|
|
11
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
12
13
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
13
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
14
15
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
@@ -52,12 +53,20 @@ function getLiveQueryClient() /*: Promise<LiveQueryClient>*/{
|
|
|
52
53
|
*/
|
|
53
54
|
var LiveQuery = /*#__PURE__*/function () {
|
|
54
55
|
function LiveQuery() {
|
|
56
|
+
var _this = this;
|
|
55
57
|
(0, _classCallCheck2.default)(this, LiveQuery);
|
|
56
58
|
var EventEmitter = _CoreManager.default.getEventEmitter();
|
|
57
59
|
this.emitter = new EventEmitter();
|
|
58
|
-
this.on =
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
this.on = function (eventName, listener) {
|
|
61
|
+
return _this.emitter.on(eventName, listener);
|
|
62
|
+
};
|
|
63
|
+
this.emit = function (eventName) {
|
|
64
|
+
var _this$emitter, _context;
|
|
65
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
66
|
+
args[_key - 1] = arguments[_key];
|
|
67
|
+
}
|
|
68
|
+
return (_this$emitter = _this.emitter).emit.apply(_this$emitter, (0, _concat.default)(_context = [eventName]).call(_context, args));
|
|
69
|
+
};
|
|
61
70
|
// adding listener so process does not crash
|
|
62
71
|
// best practice is for developer to register their own listener
|
|
63
72
|
this.on('error', function () {});
|
|
@@ -72,17 +81,17 @@ var LiveQuery = /*#__PURE__*/function () {
|
|
|
72
81
|
value: function () {
|
|
73
82
|
var _open = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
74
83
|
var liveQueryClient;
|
|
75
|
-
return _regenerator.default.wrap(function (
|
|
76
|
-
while (1) switch (
|
|
84
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
85
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
77
86
|
case 0:
|
|
78
|
-
|
|
87
|
+
_context2.next = 2;
|
|
79
88
|
return getLiveQueryClient();
|
|
80
89
|
case 2:
|
|
81
|
-
liveQueryClient =
|
|
90
|
+
liveQueryClient = _context2.sent;
|
|
82
91
|
liveQueryClient.open();
|
|
83
92
|
case 4:
|
|
84
93
|
case "end":
|
|
85
|
-
return
|
|
94
|
+
return _context2.stop();
|
|
86
95
|
}
|
|
87
96
|
}, _callee);
|
|
88
97
|
}));
|
|
@@ -103,17 +112,17 @@ var LiveQuery = /*#__PURE__*/function () {
|
|
|
103
112
|
value: function () {
|
|
104
113
|
var _close = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
105
114
|
var liveQueryClient;
|
|
106
|
-
return _regenerator.default.wrap(function (
|
|
107
|
-
while (1) switch (
|
|
115
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
116
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
108
117
|
case 0:
|
|
109
|
-
|
|
118
|
+
_context3.next = 2;
|
|
110
119
|
return getLiveQueryClient();
|
|
111
120
|
case 2:
|
|
112
|
-
liveQueryClient =
|
|
121
|
+
liveQueryClient = _context3.sent;
|
|
113
122
|
liveQueryClient.close();
|
|
114
123
|
case 4:
|
|
115
124
|
case "end":
|
|
116
|
-
return
|
|
125
|
+
return _context3.stop();
|
|
117
126
|
}
|
|
118
127
|
}, _callee2);
|
|
119
128
|
}));
|
|
@@ -135,26 +144,26 @@ var DefaultLiveQueryController = {
|
|
|
135
144
|
getDefaultLiveQueryClient: function () /*: Promise<LiveQueryClient>*/{
|
|
136
145
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
137
146
|
var _yield$Promise$all, _yield$Promise$all2, currentUser, installationId, sessionToken, liveQueryServerURL, serverURL, protocol, host, applicationId, javascriptKey, masterKey, LiveQuery;
|
|
138
|
-
return _regenerator.default.wrap(function (
|
|
139
|
-
while (1) switch (
|
|
147
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
148
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
140
149
|
case 0:
|
|
141
150
|
if (!defaultLiveQueryClient) {
|
|
142
|
-
|
|
151
|
+
_context4.next = 2;
|
|
143
152
|
break;
|
|
144
153
|
}
|
|
145
|
-
return
|
|
154
|
+
return _context4.abrupt("return", defaultLiveQueryClient);
|
|
146
155
|
case 2:
|
|
147
|
-
|
|
156
|
+
_context4.next = 4;
|
|
148
157
|
return _promise.default.all([_CoreManager.default.getUserController().currentUserAsync(), _CoreManager.default.getInstallationController().currentInstallationId()]);
|
|
149
158
|
case 4:
|
|
150
|
-
_yield$Promise$all =
|
|
159
|
+
_yield$Promise$all = _context4.sent;
|
|
151
160
|
_yield$Promise$all2 = (0, _slicedToArray2.default)(_yield$Promise$all, 2);
|
|
152
161
|
currentUser = _yield$Promise$all2[0];
|
|
153
162
|
installationId = _yield$Promise$all2[1];
|
|
154
163
|
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
155
164
|
liveQueryServerURL = _CoreManager.default.get('LIVEQUERY_SERVER_URL');
|
|
156
165
|
if (!(liveQueryServerURL && (0, _indexOf.default)(liveQueryServerURL).call(liveQueryServerURL, 'ws') !== 0)) {
|
|
157
|
-
|
|
166
|
+
_context4.next = 12;
|
|
158
167
|
break;
|
|
159
168
|
}
|
|
160
169
|
throw new Error('You need to set a proper Parse LiveQuery server url before using LiveQueryClient');
|
|
@@ -188,10 +197,10 @@ var DefaultLiveQueryController = {
|
|
|
188
197
|
defaultLiveQueryClient.on('close', function () {
|
|
189
198
|
LiveQuery.emit('close');
|
|
190
199
|
});
|
|
191
|
-
return
|
|
200
|
+
return _context4.abrupt("return", defaultLiveQueryClient);
|
|
192
201
|
case 22:
|
|
193
202
|
case "end":
|
|
194
|
-
return
|
|
203
|
+
return _context4.stop();
|
|
195
204
|
}
|
|
196
205
|
}, _callee3);
|
|
197
206
|
}))();
|