RxJS - 创建运算符 of
此运算符将接收传递的参数并将其转换为可观察对象。
语法
of(input: array[]):Observable
参数
input − 给定的输入是数组形式。
返回值
它返回一个可观察对象,其中包含来自源可观察对象的值。
示例
import { of } from 'rxjs';
let ints = of(2,4,6,8,10,12);
ints.subscribe(x => console.log(x));
前>
输出
此运算符将接收传递的参数并将其转换为可观察对象。
of(input: array[]):Observable
input − 给定的输入是数组形式。
它返回一个可观察对象,其中包含来自源可观察对象的值。
import { of } from 'rxjs';
let ints = of(2,4,6,8,10,12);
ints.subscribe(x => console.log(x));
前>
输出
