import ConsumableArray from "./consumable-array.mjs"; /** * Demonstration: Will maintain a list of 10 items */ export class SelfPopulatingList extends ConsumableArray { constructor() { super(...arguments); let count = 0; const tick = ()=> { if (this.length < 10) { this.push({ id: count++ }); } setTimeout(tick, 1000); }; setTimeout(tick); } }