mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-13 22:07:44 +02:00
16 lines
1.6 KiB
YAML
16 lines
1.6 KiB
YAML
effect/StreamEmit#Emit:
|
|
replacement: "Queue.Queue<A, E | Cause.Done>"
|
|
note: "The StreamEmit module is gone; v4 Stream.callback hands the callback a Queue<A, E | Cause.Done> instead of an Emit function. Emit values with Queue.offer/Queue.offerAll, end with Queue.end, fail with Queue.fail/Queue.failCause."
|
|
example: |
|
|
// v3: Stream.async<number, Err>((emit) => { emit.single(1); emit.end() })
|
|
Stream.callback<number, Err>((queue) =>
|
|
Effect.gen(function*() {
|
|
yield* Queue.offer(queue, 1)
|
|
yield* Queue.end(queue)
|
|
}))
|
|
effect/StreamEmit#EmitOps:
|
|
replacement: "Queue.offer / Queue.offerAll / Queue.end / Queue.fail / Queue.failCause"
|
|
note: "Method-by-method mapping onto the Queue passed to Stream.callback: single(a) -> Queue.offer(queue, a); chunk(c) -> Queue.offerAll(queue, c); end() -> Queue.end(queue); fail(e) -> Queue.fail(queue, e); halt(cause) -> Queue.failCause(queue, cause); die(d)/dieMessage(m) -> Queue.failCause(queue, Cause.die(d)); done(exit) -> Queue.offer then Queue.end on success, Queue.failCause on failure; fromEffect(eff) -> run eff and offer its value (Effect.flatMap(eff, (a) => Queue.offer(queue, a)))."
|
|
effect/StreamEmit#EmitOpsPush:
|
|
replacement: "Queue.offerUnsafe / Queue.offerAllUnsafe / Queue.endUnsafe / Queue.failCauseUnsafe"
|
|
note: "The synchronous push interface of v3 Stream.asyncPush maps to the *Unsafe Queue operations on the Queue given to Stream.callback: single/array -> Queue.offerUnsafe/Queue.offerAllUnsafe, end -> Queue.endUnsafe, fail/halt/die -> Queue.failCauseUnsafe (wrap plain errors with Cause.fail, defects with Cause.die)."
|