MCPcopy Create free account
hub / github.com/effect-app/libs / onSuccess

Function onSuccess

repos/effect/packages/effect/src/Stream.ts:7150–7168  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

7148 * depends on both sides and local state.
7149 *
7150 * **Details**
7151 *
7152 * The combining function receives the current state and pull functions for the
7153 * left and right streams. It returns the next non-empty chunk together with the
7154 * next state.
7155 *
7156 * **Example** (Combining stream chunks with state)
7157 *
7158 * ```ts import.meta.vitest
7159 * import { Effect, Stream } from "effect"
7160 *
7161 * const stream = Stream.make(1, 2).pipe(
7162 * Stream.combineArray(
7163 * Stream.make(10, 20),
7164 * () => true,
7165 * (useLeft, pullLeft, pullRight) =>
7166 * Effect.gen(function*() {
7167 * const array = useLeft ? yield* pullLeft : yield* pullRight
7168 * return [array, !useLeft] as const
7169 * })
7170 * )
7171 * )

Callers 1

Result.tsFile · 0.70

Calls 4

pushMethod · 0.80
takeNMethod · 0.65
takeMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…