array-tap
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

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);

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i array-tap

      Weekly Downloads

      170

      Version

      1.3.0

      License

      MIT

      Unpacked Size

      4.66 kB

      Total Files

      7

      Last publish

      Collaborators

      • maciejka