看this example from the learn RxJS documentation:
const source = from(people);
创建一个发射每个人的源。我添加了typing to the source in a Stackblitz example,可以按以下方式键入来源:
source:Observable<Person>
因此,看起来来源是一个单身实例的Observable
。但是,它将发出Person
的多个实例。这是如何运作的?换句话说,如果我只读source
类型,我希望该来源是Observable
,它只会发出一个人。