📜  管道的使用 - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:40.980000             🧑  作者: Mango

代码示例1
import {Observable, range} from 'rxjs';
import {map, filter} from 'rxjs/operators';

const source$: Observable = range(0, 10);

source$.pipe(
    map(x => x * 2),
    filter(x => x % 3 === 0)
).subscribe(x => console.log(x));