Skip to content

wrap()

Adapts raw callbag sources or callbag operators into first-class stores.

Signature

ts
function wrap<T>(rawSource: Callbag): Store<T>
function wrap<A, B>(input: Store<A>, rawOp: (source: Callbag) => Callbag): Store<B>

Parameters

ParameterTypeDescription
sourceOrInput`CallbagStore<any>`
rawOp(source: Callbag) =&gt; CallbagWhen set, (source) =&gt; transformedSource — STATE from input bypasses the raw op (Tier 1).

Returns

Store&lt;T&gt; or Store&lt;B&gt; — Tier 2 for bare sources (each DATA is a cycle).

Options / Behavior Details

  • Sync map only for operator form; filtering needs explicit operator() wiring.

Released under the MIT License.