You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awaitundefined;// Deferring to the next microtick so that an attempt to pull the a value before making multiple rapid synchronous calls to `put()` will make that pull ultimately yield only the last value that was put - instead of the first one as were if this otherwise wasn't deferred.
@@ -88,7 +90,7 @@ export { useAsyncIterState, type AsyncIterStateResult, type AsyncIterableSubject
88
90
* @template TVal the type of state to be set and yielded by returned iterable.
89
91
* @template TInitVal The type of the starting value for the state iterable's `.current.value` property.
90
92
*
91
-
* @param initialValue Any optional starting value for the state iterable's `.current.value` property, defaults to `undefined`.
93
+
* @param initialValue Any optional starting value for the state iterable's `.current.value` property, defaults to `undefined`. You can pass an actual value, or a function that returns a value (which the hook will call once during mounting).
92
94
*
93
95
* @returns a stateful async iterable and a function with which to yield an update, both maintain stable references across re-renders.
94
96
*
@@ -107,22 +109,17 @@ function useAsyncIterState<TVal, TInitVal = undefined>(
0 commit comments