Cleanup _.debounce and _.throttle docs. [ci skip]

This commit is contained in:
John-David Dalton
2016-07-27 07:37:36 -07:00
parent 40499af9b9
commit 8b624217c5

View File

@@ -9783,19 +9783,18 @@
* milliseconds have elapsed since the last time the debounced function was * milliseconds have elapsed since the last time the debounced function was
* invoked. The debounced function comes with a `cancel` method to cancel * invoked. The debounced function comes with a `cancel` method to cancel
* delayed `func` invocations and a `flush` method to immediately invoke them. * delayed `func` invocations and a `flush` method to immediately invoke them.
* Provide an options object to indicate whether `func` should be invoked on * Provide `options` to indicate whether `func` should be invoked on the
* the leading and/or trailing edge of the `wait` timeout. The `func` is invoked * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
* with the last arguments provided to the debounced function. Subsequent calls * with the last arguments provided to the debounced function. Subsequent
* to the debounced function return the result of the last `func` invocation. * calls to the debounced function return the result of the last `func`
* invocation.
* *
* **Note:** If `leading` and `trailing` options are `true`, `func` is invoked * **Note:** If `leading` and `trailing` options are `true`, `func` is
* on the trailing edge of the timeout only if the debounced function is * invoked on the trailing edge of the timeout only if the debounced function
* invoked more than once during the `wait` timeout. * is invoked more than once during the `wait` timeout.
* *
* If `leading` is false `func` will not be invoked immediately, even if * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* `wait` is `0`. It will be queued to run on the next tick, similar to * until to the next tick, similar to `setTimeout` with a timeout of `0`.
* how `setTimeout` behaves with a timeout of `0`. If `leading` is true,
* `func` can be invoked immediately.
* *
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.debounce` and `_.throttle`. * for details over the differences between `_.debounce` and `_.throttle`.
@@ -10383,8 +10382,8 @@
* Creates a throttled function that only invokes `func` at most once per * Creates a throttled function that only invokes `func` at most once per
* every `wait` milliseconds. The throttled function comes with a `cancel` * every `wait` milliseconds. The throttled function comes with a `cancel`
* method to cancel delayed `func` invocations and a `flush` method to * method to cancel delayed `func` invocations and a `flush` method to
* immediately invoke them. Provide an options object to indicate whether * immediately invoke them. Provide `options` to indicate whether `func`
* `func` should be invoked on the leading and/or trailing edge of the `wait` * should be invoked on the leading and/or trailing edge of the `wait`
* timeout. The `func` is invoked with the last arguments provided to the * timeout. The `func` is invoked with the last arguments provided to the
* throttled function. Subsequent calls to the throttled function return the * throttled function. Subsequent calls to the throttled function return the
* result of the last `func` invocation. * result of the last `func` invocation.
@@ -10393,6 +10392,9 @@
* invoked on the trailing edge of the timeout only if the throttled function * invoked on the trailing edge of the timeout only if the throttled function
* is invoked more than once during the `wait` timeout. * is invoked more than once during the `wait` timeout.
* *
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
*
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
* for details over the differences between `_.throttle` and `_.debounce`. * for details over the differences between `_.throttle` and `_.debounce`.
* *