Skip to content

Instantly share code, notes, and snippets.

View abir-taheer's full-sized avatar
🇵🇸
free palestine

Abir Taheer abir-taheer

🇵🇸
free palestine
View GitHub Profile
@MattiasBuelens
MattiasBuelens / tee-async-iterator.ts
Last active June 12, 2025 01:06
Teeing an async iterator
/**
* Like ReadableStream.tee(), but for any async iterable.
* https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee
*
* See: MattiasBuelens/web-streams-polyfill#80
*/
/// <reference lib="esnext" />
interface QueueNode<T> {
value: T;