npm.io
1.3.0 • Published 3 years ago

array-tap

Licence
MIT
Version
1.3.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0

Get value of array between chained calls

Tap can be placed in chains between filter and map. It expects a callback function that will get a value of array.

How to use

Import array-tap once in your project. It will extend Array with a tap method.

import 'array-tap';

["Alice", "in", "wonderland"]
  .map(str => str.length)
  .tap(arr => console.log(arr)) // prints: [5, 2, 10]
  .filter(n => n > 5);

Keywords