Improve documentation for method chaining. [ci skip]

This commit is contained in:
Philippe Lhoste
2015-09-04 13:05:02 +02:00
committed by John-David Dalton
parent 4510ada21e
commit 1be4adf365

View File

@@ -1365,13 +1365,18 @@
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/** /**
* Creates a `lodash` object which wraps `value` to enable implicit chaining. * Creates a `lodash` object which wraps `value` to enable implicit method
* Methods that operate on and return arrays, collections, and functions can * chaining. Methods that operate on and return arrays, collections, and
* be chained together. Methods that retrieve a single value or may return a * functions can be chained together. Methods that retrieve a single value or
* primitive value will automatically end the chain returning the unwrapped * may return a primitive value will automatically end the chain sequence and
* value. Explicit chaining may be enabled using `_.chain`. The execution of * return the unwrapped value. Otherwise, the value must be unwrapped with
* chained methods is lazy, that is, execution is deferred until `_#value` * `_#value`.
* is implicitly or explicitly called. *
* Explicit chaining, which requires unwrapping with `_#value` in all cases,
* may be enabled using `_.chain`.
*
* The execution of chained methods is lazy, that is, execution is deferred
* until `_#value` is implicitly or explicitly called.
* *
* Lazy evaluation allows several methods to support shortcut fusion. Shortcut * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
* fusion is an optimization strategy which merge iteratee calls; this can help * fusion is an optimization strategy which merge iteratee calls; this can help
@@ -5751,8 +5756,8 @@
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/** /**
* Creates a `lodash` object that wraps `value` with explicit method * Creates a `lodash` object that wraps `value` with explicit method chaining enabled.
* chaining enabled. * The result of such method chaining must be unwrapped with `_#value`.
* *
* @static * @static
* @memberOf _ * @memberOf _