transferum
    Preparing search index...

    Class StoredChannelTransfer<T>

    Output channel with last-value retention and external management.

    Capabilities: isOutput, isPullable, isTriggerable, isSubscribable

    Mechanics:

    1. The constructor accepts config with setup/destroy callbacks (like ChannelTransfer)
    2. setup() calls emit(data), which writes the value to _state and calls trigger()
    3. trigger() — notifies subscribers with the current value (without clearing _state)
    4. pull() — reads the current value without clearing
    5. subscribe(handler) — subscribes to notifications
    6. destroy() — calls config.destroy(), unsubscribes subscribers

    Error handling:

    • onError — for errors in emit() (when sending data to subscribers)
    • onDestroyError — for errors in destroy()
    • With the corresponding handler provided, the exception is suppressed.
    • Without a handler, the exception is rethrown.
    • setup() errors are always rethrown (no onSetupError).

    Configuration (StoredChannelTransferConfig):

    • setup: (emit: DataHandler) => void — channel initialization
    • destroy: () => void — channel cleanup
    • initialValue?: T — initial value in _state
    • onError?: ErrorHandler — emit() error handler
    • onDestroyError?: ErrorHandler — destroy() error handler

    Difference from ChannelTransfer:

    • Retains the last value (pull() is available)
    • Has trigger() for re-emitting the current value
    • emit() calls trigger() instead of sendState() + clear()

    Use cases:

    • Integration with external sources with caching
    • Channel with the ability to re-read the last value
    • Storing state from an external source

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implements

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