Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

wrapper-chain

v4.17.11arrow_drop_down
v4.17.11
STATUS
Passing
DOWNLOADS
126
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
A year ago
SIZE
1 KB
Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
1 contributor
Install wrapper-chain as a package?
Copied
npm i @bit/lodash.lodash.wrapper-chain
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Files
wrapperChain.js
34 Lines(5 sloc)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import chain from './chain.js';

/**
 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
 *
 * @name chain
 * @memberOf _
 * @since 0.1.0
 * @category Seq
 * @returns {Object} Returns the new `lodash` wrapper instance.
 * @example
 *
 * var users = [
 *   { 'user': 'barney', 'age': 36 },
 *   { 'user': 'fred',   'age': 40 }
 * ];
 *
 * // A sequence without explicit chaining.
 * _(users).head();
 * // => { 'user': 'barney', 'age': 36 }
 *
 * // A sequence with explicit chaining.
 * _(users)
 *   .chain()
 *   .head()
 *   .pick('user')
 *   .value();
 * // => { 'user': 'barney' }
 */
function wrapperChain() {
  return chain(this);
}

export default wrapperChain;