HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
bikeshaving
repeater
TypeScript2026–2026
bikeshaving / repeater

repeater

The missing constructor for creating safe async iterators

2Distinct people
2Mentions
0Explicit recommenders
482GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The missing constructor for creating safe async iterators

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour2 dated mentions

Observed mentions: 2026-02-27 15:53:08 UTC to 2026-02-27 21:32:04 UTC.

012026-02-27 15:00:00 UTC to 2026-02-27 16:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 27, 15:002026-02-27 16:00:00 UTC to 2026-02-27 17:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-27 17:00:00 UTC to 2026-02-27 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-27 18:00:00 UTC to 2026-02-27 19:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsFeb 27, 18:002026-02-27 19:00:00 UTC to 2026-02-27 20:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-27 20:00:00 UTC to 2026-02-27 21:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2026-02-27 21:00:00 UTC to 2026-02-27 22:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 27, 21:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 27, 15:002026-02-27 15:00:00 UTC2026-02-27 16:00:00 UTC101
Feb 27, 16:002026-02-27 16:00:00 UTC2026-02-27 17:00:00 UTC000
Feb 27, 17:002026-02-27 17:00:00 UTC2026-02-27 18:00:00 UTC000
Feb 27, 18:002026-02-27 18:00:00 UTC2026-02-27 19:00:00 UTC000
Feb 27, 19:002026-02-27 19:00:00 UTC2026-02-27 20:00:00 UTC000
Feb 27, 20:002026-02-27 20:00:00 UTC2026-02-27 21:00:00 UTC000
Feb 27, 21:002026-02-27 21:00:00 UTC2026-02-27 22:00:00 UTC101

What Hacker News says

2 sources
In the repeater callback, you're both calling the stop argument and awaiting it. Is it somehow both a function and a promise? Is this possible in JS? edit: I found where stop is created[1]. I can't say I've seen this pattern before, and the traditionalist in me wants to dislike the API for contradicting conventions, but I'm wondering if this was designed carefully for ergonomic benefits that outweigh the cost of violating conventions. Or if this was just toy code to try out new patterns, which is totally legit also [1]: https://github.com/repeaterjs/repeater/blob/638a53f2729f5197...
In A better streams API is possible for JavaScript
A long time ago, I wrote an abstraction called a Repeater. Essentially, the idea behind it is, what would the Promise constructor look like if it was translated to async iterables. import { Repeater } from "@repeaterjs/repeater"; const keys = new Repeater(async (push, stop) => { const listener = (ev) => { if (ev.key === "Escape") { stop(); } else { push(ev.key); } }; window.addEventListener("keyup", listener); await stop; window.removeEventListener("keyup", listener); }); const konami = ["ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown", "ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight", "b", "a"]; (async function() { let i = 0; for await (const key of keys) { if (key === konami[i]) { i++; } else { i = 0; } if (i >= konami.le
Read the rest
ngth) { console.log("KONAMI!!!"); break; // removes the keyup listener } } })(); https://github.com/repeaterjs/repeater It’s one of those abstractions that’s feature complete and stable, and looking at NPM it’s apparently getting 6.5mil+ downloads a week for some reason. Lately I’ve just taken the opposite view of the author, which is that we should just use streams, especially with how embedded they are in the `fetch` proposals and whatever. But the tee critique is devastating, so maybe the author is right. It’s exciting to see people are still thinking about this. I do think async iterables as the default abstraction is the way to go.
In A better streams API is possible for JavaScript

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.