Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / vue/src/public-api / useIterable

Function: useIterable() ​

Call Signature ​

useIterable<T>(source, initialValue?, sourceName?): IterableRef<T>

Defined in: projects/libraries/streamix/vue/src/lib/useIterable.ts:263

Reads a Streamix reactive source or any async iterable from Vue.

If source.value is genuinely undefined, a supplied initialValue is displayed instead; omit it when undefined itself is meaningful.

Streamix atoms, readables, derived values, and flows use their synchronous .value + subscribe(...) contract. Vue does not mirror that value into its own state: the returned ref reads directly from the Streamix source and is merely invalidated when the source emits.

Plain AsyncIterable<T> values have no synchronous current value, so they require an initialValue. Their latest emission is exposed through the returned ref and the iterator is closed with the current Vue effect scope.

Pass a factory to make this composable own the returned source. Owned disposable Streamix sources are disposed when the current Vue effect scope stops (component unmount, effectScope().stop(), etc.).

This composable requires an active Vue effect scope. For manual ownership outside Vue setup, use createIterableBridge and dispose it directly.

Type Parameters ​

T ​

T

Parameters ​

source ​

DependencySource<T>

initialValue? ​

T

sourceName? ​

string

Returns ​

IterableRef<T>

Call Signature ​

useIterable<T>(source, initialValue, sourceName?): IterableRef<T>

Defined in: projects/libraries/streamix/vue/src/lib/useIterable.ts:264

Reads a Streamix reactive source or any async iterable from Vue.

If source.value is genuinely undefined, a supplied initialValue is displayed instead; omit it when undefined itself is meaningful.

Streamix atoms, readables, derived values, and flows use their synchronous .value + subscribe(...) contract. Vue does not mirror that value into its own state: the returned ref reads directly from the Streamix source and is merely invalidated when the source emits.

Plain AsyncIterable<T> values have no synchronous current value, so they require an initialValue. Their latest emission is exposed through the returned ref and the iterator is closed with the current Vue effect scope.

Pass a factory to make this composable own the returned source. Owned disposable Streamix sources are disposed when the current Vue effect scope stops (component unmount, effectScope().stop(), etc.).

This composable requires an active Vue effect scope. For manual ownership outside Vue setup, use createIterableBridge and dispose it directly.

Type Parameters ​

T ​

T

Parameters ​

source ​

AsyncIterable<T>

initialValue ​

T

sourceName? ​

string

Returns ​

IterableRef<T>

Call Signature ​

useIterable<T>(factory, initialValue?): IterableRef<T>

Defined in: projects/libraries/streamix/vue/src/lib/useIterable.ts:265

Reads a Streamix reactive source or any async iterable from Vue.

If source.value is genuinely undefined, a supplied initialValue is displayed instead; omit it when undefined itself is meaningful.

Streamix atoms, readables, derived values, and flows use their synchronous .value + subscribe(...) contract. Vue does not mirror that value into its own state: the returned ref reads directly from the Streamix source and is merely invalidated when the source emits.

Plain AsyncIterable<T> values have no synchronous current value, so they require an initialValue. Their latest emission is exposed through the returned ref and the iterator is closed with the current Vue effect scope.

Pass a factory to make this composable own the returned source. Owned disposable Streamix sources are disposed when the current Vue effect scope stops (component unmount, effectScope().stop(), etc.).

This composable requires an active Vue effect scope. For manual ownership outside Vue setup, use createIterableBridge and dispose it directly.

Type Parameters ​

T ​

T

Parameters ​

factory ​

() => DependencySource<T>

initialValue? ​

T

Returns ​

IterableRef<T>

Call Signature ​

useIterable<T>(factory, initialValue): IterableRef<T>

Defined in: projects/libraries/streamix/vue/src/lib/useIterable.ts:266

Reads a Streamix reactive source or any async iterable from Vue.

If source.value is genuinely undefined, a supplied initialValue is displayed instead; omit it when undefined itself is meaningful.

Streamix atoms, readables, derived values, and flows use their synchronous .value + subscribe(...) contract. Vue does not mirror that value into its own state: the returned ref reads directly from the Streamix source and is merely invalidated when the source emits.

Plain AsyncIterable<T> values have no synchronous current value, so they require an initialValue. Their latest emission is exposed through the returned ref and the iterator is closed with the current Vue effect scope.

Pass a factory to make this composable own the returned source. Owned disposable Streamix sources are disposed when the current Vue effect scope stops (component unmount, effectScope().stop(), etc.).

This composable requires an active Vue effect scope. For manual ownership outside Vue setup, use createIterableBridge and dispose it directly.

Type Parameters ​

T ​

T

Parameters ​

factory ​

() => AsyncIterable<T>

initialValue ​

T

Returns ​

IterableRef<T>

Released under the MIT License.