👇Official Account👇
Welcome to join the group & private message
Article first/tail QR code
Appearance
of 操作符创建一个 Observable,它会依次发出你提供的任意数量的值,然后完成。
of
import { of } from 'rxjs'; of(1, 2, 3, 4, 5) .subscribe(x => console.log(x));
输出结果:
1 2 3 4 5
of 操作符通常用于创建简单的 Observable,用于测试或组合其他 Observable。