effect-io-ai

Package: effect
Module: Console

Console.count

Logs and increments the counter associated with label, using the console’s default counter when no label is provided.

Example (Counting repeated calls)

import { Console, Effect } from "effect"

const program = Effect.gen(function*() {
  yield* Console.count("my-counter")
  yield* Console.count("my-counter") // Will show: my-counter: 2
  yield* Console.count() // Default counter
})

Signature

declare const count: (label?: string) => Effect.Effect<void>

Source

Since v2.0.0