react-async-iterators
Version:
The magic of JavaScript async iterators in React ⛓️ 🧬 🔃
17 lines • 591 B
JavaScript
import { identity } from './identity.js';
export { parseReactAsyncIterable, reactAsyncIterSpecialInfoSymbol, };
function parseReactAsyncIterable(value) {
if (value[reactAsyncIterSpecialInfoSymbol]) {
const { origSource, formatFn } = value[reactAsyncIterSpecialInfoSymbol];
return {
baseIter: origSource,
formatFn: formatFn,
};
}
return {
baseIter: value,
formatFn: (identity),
};
}
const reactAsyncIterSpecialInfoSymbol = Symbol('reactAsyncIterSpecialInfoSymbol');
//# sourceMappingURL=ReactAsyncIterable.js.map