namespace / @typed/fx

Sink

Public namespace exposed as Sink from @typed/fx.

Package version
2.0.0-beta.13
Category
namespace

Import

import { Sink } from "@typed/fx";

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export * as Sink from "./Sink.js";

Members

  • Sink.Bounds

    Zero-based skip count and maximum take count used by slice.

  • Sink.Error

    Alias of Sink.Error for direct imports.

  • Sink.Service

    Defines a class-shaped Effect Context service for a Sink.

  • Sink.Services

    Alias of Sink.Services for direct imports.

  • Sink.Sink

    Consumes pushed successes and failures through effectful callbacks.

  • Sink.Success

    Alias of Sink.Success for direct imports.

  • Sink.collect

    Collects all values into an array. Pass a Ref<ReadonlyArray<A>> (e.g. Ref.make([])); after running, read the result with Ref.get(ref).

  • Sink.compact

    Forwards Some values and discards None values.

  • Sink.dropAfter

    Runs a producer callback until the first matching value has been forwarded.

  • Sink.exit

    Materializes both sink channels as successful Effect Exit values.

  • Sink.filter

    Filters values before they reach the sink using a predicate function.

  • Sink.filterEffect

    Runs an effectful predicate and forwards inputs for which it succeeds with true.

  • Sink.filterMap

    Filters and transforms values before they reach the sink using a function that returns an Option.

  • Sink.filterMapEffect

    Runs an Effect for each input and forwards its optional successful value.

  • Sink.filterMapLoop

    Threads pure state through successes and optionally forwards a derived value.

  • Sink.filterMapLoopCause

    Threads pure state through failures and optionally forwards a transformed cause.

  • Sink.filterMapLoopCauseEffect

    Threads state through an effectful failure transition and optionally forwards a cause.

  • Sink.filterMapLoopEffect

    Threads state through an effectful success transition and optionally forwards its value.

  • Sink.flip

    Exchanges a sink’s typed success and failure channels.

  • Sink.head

    Keeps only the first value. Pass a Ref<Option.Option<A>> (e.g. Ref.make(Option.none())); after running, read the result with Ref.get(ref).

  • Sink.last

    Keeps only the last value. Pass a Ref<Option.Option<A>> (e.g. Ref.make(Option.none())); after running, read the result with Ref.get(ref).

  • Sink.loop

    Threads pure state through successful inputs and forwards one derived value per input.

  • Sink.loopCause

    Threads pure state through failure causes and forwards one transformed cause per failure.

  • Sink.loopCauseEffect

    Threads state through an effectful failure transformation.

  • Sink.loopEffect

    Threads state through an effectful success transformation and forwards one value on success.

  • Sink.make

    Creates a Sink from success and failure callbacks.

  • Sink.map

    Transforms values before they reach the sink using a pure function.

  • Sink.mapEffect

    Runs an Effect for each input and forwards its successful value to the sink.

  • Sink.mapError

    Maps the error channel of a sink using the provided function. Failures are mapped via Cause.map; defects and interrupts are preserved.

  • Sink.mapInput

    Alias for map, named for the input-side direction of the transformation.

  • Sink.mapInputEffect

    Alias for mapEffect, named for the input-side direction of the effectful transformation.

  • Sink.reduce

    Reduces values into a single result using a pure function. Pass a Ref<B> (e.g. from Ref.make(initial)); after running, read the result with Ref.get(ref).

  • Sink.reduceEffect

    Reduces values into a single result using an effectful function. Pass a Ref<B>; after running, read the result with Ref.get(ref). If the reducer effect fails, the ref is left unchanged (Sink onSuccess is typed as never failing).

  • Sink.skipInterrupt

    Suppresses failure causes made entirely of interruption reasons.

  • Sink.slice

    Runs a producer callback through a bounded view of a sink.

  • Sink.tapEffect

    Runs an effectful observation before forwarding each successful input unchanged.

  • Sink.withEarlyExit

    Runs a producer-style callback with a sink that can complete the surrounding Effect early.

  • Sink.withState

    Runs a callback with an early-exit sink and a private Effect Ref initialized to state.

  • Sink.withStateSemaphore

    Runs a callback with private state whose effectful reads and writes are serialized.

Source