@@ -3,9 +3,12 @@ import { callOrReturn } from '../common/callOrReturn.js';
33import { useRefWithInitialValue } from '../common/hooks/useRefWithInitialValue.js' ;
44import { type MaybeFunction } from '../common/MaybeFunction.js' ;
55import { type Iterate } from '../Iterate/index.js' ; // eslint-disable-line @typescript-eslint/no-unused-vars
6- import { AsyncIterableChannel , type AsyncIterableSubject } from '../common/AsyncIterableChannel.js' ;
6+ import {
7+ AsyncIterableChannel ,
8+ type AsyncIterableChannelSubject ,
9+ } from '../common/AsyncIterableChannel.js' ;
710
8- export { useAsyncIterState , type AsyncIterStateResult , type AsyncIterableSubject } ;
11+ export { useAsyncIterState , type AsyncIterStateResult , type AsyncIterableChannelSubject } ;
912
1013/**
1114 * Basically like {@link https://react.dev/reference/react/useState `React.useState`}, only that the value
@@ -148,11 +151,11 @@ type AsyncIterStateResult<TVal, TInitVal> = [
148151 * meaning multiple iterators can be consumed (iterated) simultaneously, each one picking up the
149152 * same values as others the moment they were generated through state updates.
150153 */
151- values : AsyncIterableSubject < TVal , TInitVal > ,
154+ values : AsyncIterableChannelSubject < TVal , TInitVal > ,
152155
153156 /**
154157 * A function which updates the state, causing the paired async iterable to yield the updated state
155158 * value and immediately sets its `.current.value` property to the latest state.
156159 */
157- setValue : ( update : TVal | ( ( prevState : TVal | TInitVal ) => TVal ) ) => void ,
160+ setValue : ( update : MaybeFunction < TVal , [ prevState : TVal | TInitVal ] > ) => void ,
158161] ;
0 commit comments