Skip to content

Commit 290979b

Browse files
author
p01
committed
Added a note about throttled methods.
1 parent acb9781 commit 290979b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib/functionprototype.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
/**
22
* Throttle the function to run at most every delay ms
33
* @argument delay {Number}
4+
*
5+
* Note: Throttled methods are argument-less because we don't know which set of
6+
* arguments ( among the ones passed to all the throttled calls ) to pass to the
7+
* method it is eventually called. Instead they should use a state or context
8+
* variable of their scope.
49
*/
510
Function.prototype.throttle || (Function.prototype.throttle = function(delay)
611
{

0 commit comments

Comments
 (0)