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

Related issues

pavelkornev picture pavelkornev  路  4Comments

stephanwlee picture stephanwlee  路  3Comments

zimtsui picture zimtsui  路  3Comments

fearphage picture fearphage  路  3Comments

andys8 picture andys8  路  4Comments