Skip to content

Commit f86a313

Browse files
committed
more done
1 parent 42b2d32 commit f86a313

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Diff for: src/useAsyncIterMemo/index.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { useMemo } from 'react';
2-
import { type FixedRefFormattedIterable } from '../iterateFormatted/index.js';
32
import {
43
reactAsyncIterSpecialInfoSymbol,
4+
type ReactAsyncIterable,
55
type ReactAsyncIterSpecialInfo,
6-
} from '../common/reactAsyncIterSpecialInfoSymbol.js';
6+
} from '../common/ReactAsyncIterable.js';
77
import { useLatest } from '../common/hooks/useLatest.js';
88
import { asyncIterSyncMap } from '../common/asyncIterSyncMap.js';
9-
import { type ExtractAsyncIterValue } from '../common/ExtractAsyncIterValue.js';
9+
import { type DeasyncIterized } from '../common/DeasyncIterized.js';
1010

1111
export { useAsyncIterMemo };
1212

@@ -41,7 +41,7 @@ const useAsyncIterMemo: {
4141
return asyncIterSyncMap(
4242
specialInfo.origSource,
4343
value =>
44-
(latestDepsRef.current[i] as FixedRefFormattedIterable<unknown, unknown>)[
44+
(latestDepsRef.current[i] as ReactAsyncIterable<unknown, unknown>)[
4545
reactAsyncIterSpecialInfoSymbol
4646
].formatFn(value, iterationIdx++) // TODO: Any change there won't be a `.formatFn` here if its possible that this might be called somehow at the moment the deps were changed completely?
4747
);
@@ -59,13 +59,11 @@ type DepsWithReactAsyncItersWrapped<TDeps extends React.DependencyList> = {
5959
[Symbol.asyncIterator](): AsyncIterator<unknown>;
6060
[reactAsyncIterSpecialInfoSymbol]: ReactAsyncIterSpecialInfo<unknown, unknown>;
6161
}
62-
? AsyncIterable<ExtractAsyncIterValue<TDeps[I]>>
62+
? AsyncIterable<DeasyncIterized<TDeps[I]>>
6363
: TDeps[I];
6464
};
6565

66-
function isReactAsyncIterable<T>(
67-
input: T
68-
): input is T & FixedRefFormattedIterable<unknown, unknown> {
66+
function isReactAsyncIterable<T>(input: T): input is T & ReactAsyncIterable<unknown, unknown> {
6967
const inputAsAny = input as any;
7068
return !!inputAsAny?.[reactAsyncIterSpecialInfoSymbol];
7169
}

0 commit comments

Comments
 (0)