aboutsummaryrefslogtreecommitdiffziptar.gz
path: root/viewer/js/latest.js
blob: d20b5d55927722f5c5d984bc88e47662dc00bc26 (plain)
1
2
3
4
5
6
// latest.js — overlapping async calls: only the newest one's answer is applied.
export class Latest {
  n = 0;
  next() { return ++this.n; }
  is(k) { return k === this.n; }
}