0.1.0 • Published 9 years ago

@ersinfotech/chain v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

chain

Chaining lodash individual method

Usage

import chain from 'chain';
import flatten from 'lodash/array/flatten';
import compact from 'lodash/array/compact';
import map from 'lodash/collection/map';

var list = [
  [1, null, 2],
  null,
  3
];

var result = chain(list)
  .thru(flatten)
  .thru(compact)
  .tap(d => console.log(d)) // [1, 2, 3]
  .thru(map, d => d + 1)
  .value() // [2, 3, 4]

License

MIT

0.1.0

9 years ago