Commit afda31a8 by Иван Кубота

Store.debounce now return function that have now method

parent c18a196b
...@@ -710,14 +710,21 @@ Store.debounce = function(fn, dt, strictDelay) { ...@@ -710,14 +710,21 @@ Store.debounce = function(fn, dt, strictDelay) {
timeout = false; timeout = false;
fn.apply(scope, args) fn.apply(scope, args)
}; };
return function(){ var out = function(){
lastCall = +new Date(); lastCall = +new Date();
args = [].slice.call(arguments); args = [].slice.call(arguments);
scope = this; scope = this;
if(!timeout){ if(!timeout){
timeout = setTimeout(realCall, dt); timeout = setTimeout(realCall, dt);
} }
};
out.now = function(anyway){
if(timeout || anyway) {
clearTimeout( timeout )
realCall();
}
} }
return out;
}; };
var HookPrototype = function() {}; var HookPrototype = function() {};
HookPrototype.prototype = { HookPrototype.prototype = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment