Function
peek
(self: TxPriorityQueue<A>)
Source from the content-addressed store, hash-verified
| 268 | * @since 2.0.0 |
| 269 | */ |
| 270 | export 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
Tested by
no test coverage detected