mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -1,9 +1,46 @@
|
||||
/** @module dataStructures */
|
||||
__PluginManager__.register('dataStructures', function(module, exports, require, global){
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param context
|
||||
* @param callback
|
||||
* @param interval
|
||||
* @constructor
|
||||
*/
|
||||
function Interval(context, callback, interval = 1000){
|
||||
/** @private */
|
||||
this.context = context || window;
|
||||
/** @private */
|
||||
this.callback = callback;
|
||||
/** @private */
|
||||
this.interval = interval;
|
||||
|
||||
}
|
||||
Interval.prototype.start = function () {
|
||||
/** @private */
|
||||
this.intervalId = setInterval(function () {
|
||||
this.callback.apply(this.context, arguments);
|
||||
}.bind(this), this.interval)
|
||||
};
|
||||
Interval.prototype.stop = function () {
|
||||
if(this.intervalId){
|
||||
clearInterval(this.intervalId);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Stack – LIFO
|
||||
* Queue – FIFO
|
||||
* @type dataStructures
|
||||
* @memberOf kit
|
||||
*/
|
||||
var dataStructures = {
|
||||
const dataStructures = {
|
||||
|
||||
StackExecutionLimiter: (function () {
|
||||
var stack = function (context, callback, timeout = 1000) {
|
||||
this.counter = 0;
|
||||
@@ -59,7 +96,9 @@ __PluginManager__.register('dataStructures', function(module, exports, require,
|
||||
this.counter = 0;
|
||||
};
|
||||
return stack;
|
||||
})()
|
||||
})(),
|
||||
|
||||
Interval,
|
||||
};
|
||||
|
||||
return module.exports = dataStructures;
|
||||
|
||||
Reference in New Issue
Block a user