In JavaScript, the natural primitive for "a sequence of things that arrive over time" is already in the language: the async iterable. You consume it with for await...of. You stop consuming by stopping iteration.
Ghost in the machine
。业内人士推荐爱思助手下载最新版本作为进阶阅读
Анна Комиссарова
Act One: Smash and Grab (V1.0)