(self: Dequeue<A, E>)
| 1457 | * @since 2.0.0 |
| 1458 | */ |
| 1459 | export const poll = <A, E>(self: Dequeue<A, E>): Effect<Option.Option<A>> => |
| 1460 | internalEffect.suspend(() => { |
| 1461 | const result = takeUnsafe(self) |
| 1462 | if (result === undefined) { |
| 1463 | return internalEffect.succeed(Option.none()) |
| 1464 | } |
| 1465 | if (result._tag === "Success") { |
| 1466 | return internalEffect.succeed(Option.some(result.value)) |
| 1467 | } |
| 1468 | return internalEffect.succeed(Option.none()) |
| 1469 | }) |
| 1470 | |
| 1471 | /** |
| 1472 | * Peeks at the next item without removing it. |
nothing calls this directly
no test coverage detected