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
8
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
10 months ago
SIZE
1 KB
Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
1 contributor
Use wrapper-chain in your project ?
Copied
npm i @bit/lodash.lodash.wrapper-chain
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
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.
modifieddraft
chevron_left
chevron_right
chain () : Object

Creates a lodash wrapper instance with explicit method chain sequences enabled.

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' }
Returns
Object

Returns the new `lodash` wrapper instance.