From 7157d0187f46d274804d88469b1c7479da6bc80b Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 4 Jan 2012 15:22:33 -0500 Subject: [PATCH] removing voluminous verbose verbiage --- index.html | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/index.html b/index.html index 9ec7b5f88..c5719e795 100644 --- a/index.html +++ b/index.html @@ -790,17 +790,11 @@ _.defer(function(){ alert('deferred'); });

throttle_.throttle(function, wait)
- Returns a throttled version of the function, that, when invoked repeatedly, - will only actually call the wrapped function at most once per every wait + Creates and returns a new, throttled version of the passed function, + that, when invoked repeatedly, will only actually call the original function + at most once per every wait milliseconds. Useful for rate-limiting events that occur faster than you can keep up with. -
-
- This method returns a function; it does - not itself execute its first argument. You should call _.throttle - only once for each function you wish to throttle (not repeatedly!). - It is the function returned from that once call to _.throttle - that you should invoke on each occurrance of the event you wish to throttle.

 var throttled = _.throttle(updatePosition, 100);
@@ -810,23 +804,13 @@ $(window).scroll(throttled);
       

debounce_.debounce(function, wait)
- Calling a debounced function will postpone its execution until after - wait milliseconds have elapsed since the last time the function + Creates and returns a new debounced version of the passed function that + will postpone its execution until after + wait milliseconds have elapsed since the last time it was invoked. Useful for implementing behavior that should only happen after the input has stopped arriving. For example: rendering a preview of a Markdown comment, recalculating a layout after the window - has stopped being resized, etc. -
-
- Please note that the first invocation of a debounced function will *not* - immediately execute it, but rather, the first execution will be at least wait - milliseconds later. -
-
- As with throttle, this method returns a function; it does - not itself execute its first argument. You should call _.debounce - only once for each function you wish to debounce, and you should - call the returned function every time the event you wish to debounce occurs. + has stopped being resized, and so on.

 var lazyLayout = _.debounce(calculateLayout, 300);