MCPcopy Create free account
hub / github.com/Effect-TS/effect / paginate

Function paginate

packages/effect/src/internal/stream.ts:4528–4532  ·  view source on GitHub ↗
(s: S, f: (s: S) => readonly [A, Option.Option<S>])

Source from the content-addressed store, hash-verified

4526
4527/** @internal */
4528export const paginate = <S, A>(s: S, f: (s: S) => readonly [A, Option.Option<S>]): Stream.Stream<A> =>
4529 paginateChunk(s, (s) => {
4530 const page = f(s)
4531 return [Chunk.of(page[0]), page[1]] as const
4532 })
4533
4534/** @internal */
4535export const paginateChunk = <S, A>(

Callers

nothing calls this directly

Calls 3

paginateChunkFunction · 0.85
ofMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected