An inspector to see the passing value.
An identity function.
import { cat, inspect } from "./cat.ts";
import { assertEquals } from "../deps.ts";
const result = cat(-3)
.feed(inspect((x) => assertEquals(x, -3)))
.feed((x) => x ** 2)
.feed(inspect((x) => assertEquals(x, 9)))
.feed((x) => x.toString())
.feed(inspect((x) => assertEquals(x, "9")));
assertEquals(result.value, "9");
Generated using TypeDoc
Inspects the passing value with an inspector. It is useful for using some side effects.