Comparing version 0.5.1 to 0.5.2
@@ -46,2 +46,6 @@ 'use strict'; | ||
// Defaults | ||
var _defaultDebounce = 1000 / 60; | ||
var _defaultBatchSize = 10; | ||
/** | ||
@@ -60,3 +64,3 @@ * Observable cursor is used for making request auto-updatable | ||
_this.update = (0, _debounce2.default)((0, _bind3.default)(_this.update, _this), 1000 / 15, 10); | ||
_this.update = (0, _debounce2.default)((0, _bind3.default)(_this.update, _this), _defaultDebounce, _defaultBatchSize); | ||
_this.maybeUpdate = (0, _bind3.default)(_this.maybeUpdate, _this); | ||
@@ -66,14 +70,14 @@ return _this; | ||
/** | ||
* Change a batch size of updater. | ||
* Btach size is a number of changes must be happen | ||
* in debounce interval to force execute debounced | ||
* function (update a result, in our case) | ||
* | ||
* @param {Number} batchSize | ||
* @return {CursorObservable} | ||
*/ | ||
_createClass(CursorObservable, [{ | ||
key: 'batchSize', | ||
/** | ||
* Change a batch size of updater. | ||
* Btach size is a number of changes must be happen | ||
* in debounce interval to force execute debounced | ||
* function (update a result, in our case) | ||
* | ||
* @param {Number} batchSize | ||
* @return {CursorObservable} | ||
*/ | ||
value: function batchSize(_batchSize) { | ||
@@ -297,2 +301,12 @@ this.update.updateBatchSize(_batchSize); | ||
} | ||
}], [{ | ||
key: 'defaultDebounce', | ||
value: function defaultDebounce(waitTime) { | ||
_defaultDebounce = waitTime; | ||
} | ||
}, { | ||
key: 'defaultBatchSize', | ||
value: function defaultBatchSize(batchSize) { | ||
_defaultBatchSize = batchSize; | ||
} | ||
}]); | ||
@@ -299,0 +313,0 @@ |
@@ -10,2 +10,6 @@ import _bind from 'fast.js/function/bind'; | ||
// Defaults | ||
let _defaultDebounce = 1000 / 60; | ||
let _defaultBatchSize = 10; | ||
/** | ||
@@ -18,6 +22,18 @@ * Observable cursor is used for making request auto-updatable | ||
super(db, query, options); | ||
this.update = debounce(_bind(this.update, this), 1000 / 15, 10); | ||
this.update = debounce( | ||
_bind(this.update, this), | ||
_defaultDebounce, | ||
_defaultBatchSize | ||
); | ||
this.maybeUpdate = _bind(this.maybeUpdate, this); | ||
} | ||
static defaultDebounce(waitTime) { | ||
_defaultDebounce = waitTime; | ||
} | ||
static defaultBatchSize(batchSize) { | ||
_defaultBatchSize = batchSize; | ||
} | ||
/** | ||
@@ -24,0 +40,0 @@ * Change a batch size of updater. |
{ | ||
"name": "marsdb", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Artem Artemev", |
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
812058
18982