transferum
    Preparing search index...

    Class ConditionTransfer<T>

    Transfer with conditional filtering on input and output.

    Capabilities: isInput, isOutput, isPushable, isSubscribable

    Mechanics:

    1. The constructor accepts config with two predicates:
      • shouldAccept(data) — input filter (if false, data is ignored)
      • shouldEmit(data) — output filter (if false, data is ignored)
    2. push(data) — checks shouldAccept, if true — checks shouldEmit, if true — notifies subscribers and clears state
    3. subscribe(handler) — subscribes to notifications
    4. destroy() — unsubscribes subscribers, clears state

    Error handling:

    • If shouldAccept throws an exception, onAcceptError is called.
    • If shouldEmit throws an exception, onEmitError is called.
    • With the corresponding handler provided, the exception is suppressed.

    Configuration (ConditionTransferConfig):

    • shouldAccept?: (data: T) => boolean — input filter (default: always true)
    • shouldEmit?: (data: T) => boolean — output filter (default: always true)
    • onAcceptError?: ErrorHandler — shouldAccept error handler
    • onEmitError?: ErrorHandler — shouldEmit error handler

    Use cases:

    • Filtering data by value (e.g., only even numbers)
    • Blocking duplicates (shouldEmit checks the previous value)
    • Throttling/debouncing via time-based conditions
    • Validating data before forwarding

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

    Index
    _state: ProxyReference<T>
    isAsyncPollingProxy: boolean = false
    isAsyncPullable: boolean = false
    isAsyncPushable: boolean = false
    isAsyncTriggerable: boolean = false
    isDuplex: true
    isGate: boolean = false
    isInput: true
    isOutput: true
    isPollingProxy: boolean = false
    isPollingSource: boolean = false
    isPullable: boolean = false
    isPushable: true
    isSubscribable: true
    isTriggerable: boolean = false