Skip to content

tap

tap<S, A>(f): (st) => State<S, A>

Defined in: Core/State.ts:166

Runs a side effect on the produced value without changing the State computation.

S

A

(a) => void

(st): State<S, A>

State<S, A>

State<S, A>

pipe(
  State.get<number>(),
  State.tap(n => console.log("current:", n)),
  State.chain(() => State.modify(n => n + 1)),
);