Patch Changes
-
#2205
d944330Thanks @lloydrichards! - add support for merging external events intoPrompt.customrender loops via an optionaleventsdequeue andreceivehandler.The prompt races user input against events from the dequeue, allowing background events to trigger re-renders without waiting for a keypress:
const eventQueue = yield * Queue.make<number>(); const prompt = Prompt.custom( { count: 0 }, Queue.asDequeue(eventQueue), // <-- provide the event queue as a dequeue to the prompt { render: (state) => Effect.succeed(`Count: ${state.count}`), process: (input, state) => Effect.succeed( Match.value(input).pipe( // handle user input Match.tag("Input", () => Action.Submit({ value: state.count })), // handle external events from the queue Match.tag("Event", (input) => Action.NextFrame({ state: { count: state.count + input.value } }), ), Match.exhaustive, ), ), clear: () => Effect.succeed(""), }, );
-
#2369
f48659fThanks @gcanti! - Round fractional durations symmetrically when normalizing to nanoseconds. -
#2373
7652aaaThanks @StarpTech! - Stream.fromReadableStream: swallow thereader.cancel()rejection in the finalizer. Cancelling the reader of an already-errored ReadableStream rejects with the stored error, which turned the typedonErrorfailure into a defect. -
#2371
98630b7Thanks @gcanti! - EmitSchema.ObjectKeywordas an object-or-array JSON Schema union. -
#2376
90ae23cThanks @fubhy! - AddGraph.successorsandGraph.predecessors, deprecateGraph.neighborsDirected, and fix graph algorithm edge cases around reversal, undirected edge queries, shortest-path weight validation, topological sort initials, and strongly connected components.