Skip to content

@epikodelabs/streamix


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

Function: useIterable() ​

Call Signature ​

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

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

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

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.).

Type Parameters ​

T ​

T

Parameters ​

source ​

DependencySource<T>

initialValue? ​

T

Returns ​

IterableRef<T>

Call Signature ​

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

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

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

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.).

Type Parameters ​

T ​

T

Parameters ​

source ​

AsyncIterable<T>

initialValue ​

T

Returns ​

IterableRef<T>

Call Signature ​

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

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

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

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.).

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:205

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

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.).

Type Parameters ​

T ​

T

Parameters ​

factory ​

() => AsyncIterable<T>

initialValue ​

T

Returns ​

IterableRef<T>

Released under the MIT License.