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

Function peek

packages/effect/src/TxPriorityQueue.ts:270–278  ·  view source on GitHub ↗
(self: TxPriorityQueue<A>)

Source from the content-addressed store, hash-verified

268 * @since 2.0.0
269 */
270export const peek = <A>(self: TxPriorityQueue<A>): Effect.Effect<A> =>
271 Effect.gen(function*() {
272 const chunk = yield* TxRef.get(self.ref)
273 const head = C.head(chunk)
274 if (O.isNone(head)) {
275 return yield* Effect.txRetry
276 }
277 return head.value
278 }).pipe(Effect.tx)
279
280/**
281 * Observes the smallest element without removing it, returning `None` when the

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected