mirror of
https://github.com/jbranchaud/til
synced 2026-01-08 17:48:01 +00:00
Add some clarifications.
This commit is contained in:
@@ -12,8 +12,9 @@ You can roll your own approach to sufficiently intermittent server calls.
|
|||||||
Though, it turns out that [underscore.js](http://underscorejs.org/) comes
|
Though, it turns out that [underscore.js](http://underscorejs.org/) comes
|
||||||
with two functions out of the box for this kind of behavior.
|
with two functions out of the box for this kind of behavior.
|
||||||
|
|
||||||
- [`throttle`](http://underscorejs.org/#throttle) will give you function
|
- [`throttle`](http://underscorejs.org/#throttle) will give you a function
|
||||||
that wraps your function in a way that essentially rate-limits it.
|
that wraps your function in a way that essentially rate-limits it to being
|
||||||
|
called at most once every `N` milliseconds.
|
||||||
|
|
||||||
- [`debounce`](http://underscorejs.org/#debounce), on the other hand, will
|
- [`debounce`](http://underscorejs.org/#debounce), on the other hand, will
|
||||||
give you a function that only calls your function once `N` milliseconds
|
give you a function that only calls your function once `N` milliseconds
|
||||||
|
|||||||
Reference in New Issue
Block a user