twilio-sync
Advanced tools
Comparing version 0.3.2 to 0.3.3
@@ -53,3 +53,5 @@ 'use strict'; | ||
function substract(p1, p2) { | ||
var MAX_SUBSCRIPTION_BATCH_SIZE = 100; | ||
function substract(p1, p2, limit) { | ||
var result = []; | ||
@@ -68,2 +70,5 @@ var _iteratorNormalCompletion = true; | ||
result.push({ sid: key, type: value.type }); | ||
if (limit && result.length >= limit) { | ||
break; | ||
} | ||
} | ||
@@ -151,5 +156,3 @@ } | ||
var listToAdd = substract(this._subscriptions, this._persisted).filter(function (x) { | ||
return x.sid; | ||
}); | ||
var listToAdd = substract(this._subscriptions, this._persisted, MAX_SUBSCRIPTION_BATCH_SIZE); | ||
if (listToAdd.length > 0) { | ||
@@ -159,3 +162,3 @@ return { action: 'establish', list: listToAdd }; | ||
var listToRemove = substract(this._persisted, this._subscriptions).map(function (x) { | ||
var listToRemove = substract(this._persisted, this._subscriptions, MAX_SUBSCRIPTION_BATCH_SIZE).map(function (x) { | ||
return { sid: x.sid, type: _this2._types.get(x.sid) }; | ||
@@ -162,0 +165,0 @@ }); |
{ | ||
"name": "twilio-sync", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Twilio Sync client library", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1558593
21116