UNPKG

react-async-iterators

Version:

The magic of JavaScript async iterators in React ⛓️ 🧬 🔃

12 lines (11 loc) 661 B
import type * as React from 'react'; import { type ReactAsyncIterable } from '../../ReactAsyncIterable.js'; import { type DeasyncIterized } from '../../DeasyncIterized.js'; export { useAsyncIterMemo }; declare const useAsyncIterMemo: { <TRes, const TDeps extends React.DependencyList>(factory: (...depsWithWrappedAsyncIters: DepsWithReactAsyncItersWrapped<TDeps>) => TRes, deps: TDeps): TRes; <TRes>(factory: () => TRes, deps: []): TRes; }; type DepsWithReactAsyncItersWrapped<TDeps extends React.DependencyList> = { [I in keyof TDeps]: TDeps[I] extends ReactAsyncIterable<unknown, unknown> ? AsyncIterable<DeasyncIterized<TDeps[I]>> : TDeps[I]; };