Skip to main content

Variable: consume()

const consume: (iterable) => void

Defined in: side-effects.d.ts:282

Iterates through iterable causing lazy operations to run.

Parameters

iterable

Iterable<unknown>

Returns

void

Example

import { consume, each, pipe } from 'lfi'

const iterable = pipe(
[`sloth`, `lazy`, `sleep`],
each(console.log),
)
// No output

consume(iterable)
//=> sloth
//=> lazy
//=> sleep
Playground

Since

v2.0.0