Skip to content

Commit

Permalink
"throttle" is actually a "debounce" in the example
Browse files Browse the repository at this point in the history
  • Loading branch information
ALeschinsky authored and mroderick committed Jan 23, 2018
1 parent d929b22 commit 2d0509e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ Test framework integration can typically reduce boilerplate further. [Learn more
_[Brian Cavalier, Cujo.JS](https://twitter.com/briancavalier/status/225617077346635776)_

Testing time-sensitive logic without the wait is a breeze with Sinon.JS. The following function throttles another function - only when it has not been called for 100 milliseconds will it call the original function with the last set of arguments it received.
Testing time-sensitive logic without the wait is a breeze with Sinon.JS. The following function debounces another function - only when it has not been called for 100 milliseconds will it call the original function with the last set of arguments it received.

```javascript
function throttle(callback) {
function debounce(callback) {
var timer;
return function () {
clearTimeout(timer);
Expand Down

0 comments on commit 2d0509e

Please sign in to comment.