Hyperlinkv0.8.0-beta.28

Queue

Queue.asDequeueconsteffect/Queue.ts:133
<A, E>(self: Queue<A, E>): Dequeue<A, E>

Narrows a Queue to a Dequeue, exposing the consumer side of the queue.

When to use

Use to pass a queue to code that should consume values while keeping producer-side operations out of that code's TypeScript type.

Gotchas

This is a type-level narrowing operation. It returns the same queue object and does not create a runtime wrapper.

Source effect/Queue.ts:1331 lines
export const asDequeue: <A, E>(self: Queue<A, E>) => Dequeue<A, E> = identity