MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromEffectOption

Function fromEffectOption

packages/effect/src/internal/stream.ts:3105–3116  ·  view source on GitHub ↗
(effect: Effect.Effect<A, Option.Option<E>, R>)

Source from the content-addressed store, hash-verified

3103
3104/** @internal */
3105export const fromEffectOption = <A, E, R>(effect: Effect.Effect<A, Option.Option<E>, R>): Stream.Stream<A, E, R> =>
3106 new StreamImpl(
3107 channel.unwrap(
3108 Effect.match(effect, {
3109 onFailure: Option.match({
3110 onNone: () => core.void,
3111 onSome: core.fail
3112 }),
3113 onSuccess: (a) => core.write(Chunk.of(a))
3114 })
3115 )
3116 )
3117
3118/** @internal */
3119export const fromPubSub: {

Callers 3

failFunction · 0.85
failSyncFunction · 0.85
stream.tsFile · 0.85

Calls 2

writeMethod · 0.65
ofMethod · 0.65

Tested by

no test coverage detected