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

Function takeBetween

packages/effect/src/Queue.ts:1372–1379  ·  view source on GitHub ↗
(
  self: Dequeue<A, E>,
  min: number,
  max: number
)

Source from the content-addressed store, hash-verified

1370 * @since 2.0.0
1371 */
1372export const takeBetween = <A, E>(
1373 self: Dequeue<A, E>,
1374 min: number,
1375 max: number
1376): Effect<Array<A>, E> =>
1377 internalEffect.suspend(() =>
1378 takeBetweenUnsafe(self, min, max) ?? internalEffect.andThen(awaitTake(self), takeBetween(self, 1, max))
1379 )
1380
1381/**
1382 * Takes a single message from the queue, or wait for a message to be

Callers 2

takeAllFunction · 0.85
takeNFunction · 0.85

Calls 2

takeBetweenUnsafeFunction · 0.85
awaitTakeFunction · 0.85

Tested by

no test coverage detected