Sinon: Website http://sinonjs.org/, in examples,`throttle` should be called `debounce`

Created on 2 Nov 2017  ·  4Comments  ·  Source: sinonjs/sinon

function throttle(callback) {
    var timer;
    return function () {
        clearTimeout(timer);
        var args = [].slice.call(arguments);
        timer = setTimeout(function () {
            callback.apply(this, args);
        }, 100);
    };
}

I'm pretty sure that's debounce... throttle should call the function immediately, this one waits first...

Help wanted

All 4 comments

The docs live here in the report. Under /docs. You can actually do the entire fix, including the PR, without leaving your browser, using the in-browser editing of Github. Feel free ;-)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This was fixed with #1672

Was this page helpful?
0 / 5 - 0 ratings