Perform a side effect with each element while passing the value on. Useful for inspecting items they pass through a pipeline.
import { pipe } from "yta";import { aside, map, range, toArray } from "yta/sync";pipe( range(5), map((n) => n ** 2), aside((n) => { // Inspect the state at this point. console.log(n); }), toArray(),);// => [0, 1, 4, 9, 16]// console logs `0`, `1`, `4`, `9`, and `16`. Copy
import { pipe } from "yta";import { aside, map, range, toArray } from "yta/sync";pipe( range(5), map((n) => n ** 2), aside((n) => { // Inspect the state at this point. console.log(n); }), toArray(),);// => [0, 1, 4, 9, 16]// console logs `0`, `1`, `4`, `9`, and `16`.
See also:
The item type
The side effect producing function
Perform a side effect with each element while passing the value on. Useful for inspecting items they pass through a pipeline.
See also: