mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
Replace timeOutAction() with debounce
Replace delegateRun() Revert my throttle/debounce setTimeout() to Function.prototype[throttle/debounce]
This commit is contained in:
parent
f6a55898c7
commit
97a73c6639
28 changed files with 225 additions and 372 deletions
|
|
@ -52,12 +52,7 @@ class Selector {
|
|||
this.focusedItem = koFocusedItem || ko.observable(null);
|
||||
this.selectedItem = koSelectedItem || ko.observable(null);
|
||||
|
||||
var d, o = this;
|
||||
this.itemSelectedThrottle = (item)=>{
|
||||
// debounce
|
||||
clearTimeout(d);
|
||||
d = setTimeout(()=>o.itemSelected(item), 300);
|
||||
};
|
||||
this.itemSelectedThrottle = (item=>this.itemSelected(item)).debounce(300);
|
||||
|
||||
this.listChecked.subscribe((items) => {
|
||||
if (items.length) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue