A lightweight JSON RPC client & server
Home > async-call-rpc > AsyncGeneratorVersionOf
Make all generator in the type T becomes AsyncGenerator
Signature:
export type AsyncGeneratorVersionOf<T> = T extends Record<keyof T, _IteratorOrIterableFunction> ? 'then' extends keyof T ? Omit<Readonly<T>, 'then'> : T : _AsyncGeneratorVersionOf<T>;
Only generics signatures on function that returning an AsyncGenerator
Method called then
are intentionally removed because it is very likely to be a foot gun in promise auto-unwrap.