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

Function makeExportStream

packages/vue/examples/streamMutation.ts:45–52  ·  view source on GitHub ↗
(total: S.NonNegativeInt)

Source from the content-addressed store, hash-verified

43 * Each step is separated by a 50 ms delay to simulate real async work.
44 */
45const makeExportStream = (total: S.NonNegativeInt): Stream.Stream<ExportEvent> =>
46 Stream.concat(
47 Stream.range(1, total).pipe(
48 Stream.map((completed) => new OperationProgress({ completed: S.NonNegativeInt(completed), total })),
49 Stream.tap(() => Effect.sleep("50 millis"))
50 ),
51 Stream.make(new ExportComplete({ fileUrl: S.NonEmptyString("https://example.com/export.csv") }))
52 )
53
54// ---------------------------------------------------------------------------
55// Option A: low-level `asStreamResult` (call inside a `setup()` function)

Callers 1

useExportMutationFunction · 0.85

Calls 4

pipeMethod · 0.65
mapMethod · 0.65
sleepMethod · 0.65
makeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…