Subversion Repositories eFlore/Applications.cel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3845 idir 1
export function debounce (callback, delay) {
2
    let timer;
3
    return function(){
4
        const args = arguments;
5
        const context = this;
6
        clearTimeout(timer);
7
        timer = setTimeout(function(){
8
            callback.apply(context, args);
9
        }, delay)
10
    }
11
}