我正在关注https://angular.io上的教程,但我找不到文档; 专门针对方法pipe和tap.我在https://angular.io或http://reactivex.io/rxjs/上找不到任何内容.
我的理解是,pipe和tap有两种方法Observable,它正在从RxJS进口,是否正确?他们该怎么办?
我应该在哪里寻找方法的文档?
Dan*_*cal 79
你是对的,文档缺乏这些方法.然而,当我挖掘到rxjs存储库时,我发现了关于tap(太长时间无法粘贴)和管道运算符的好评:
/**
* Used to stitch together functional operators into a chain.
* @method pipe
* @return {Observable} the Observable result of all of the operators having
* been called in the order they were passed in.
*
* @example
*
* import { map, filter, scan } from 'rxjs/operators';
*
* Rx.Observable.interval(1000)
* .pipe(
* filter(x => x % 2 === 0),
* map(x => x + x),
* scan((acc, x) => acc + x)
* )
* .subscribe(x => console.log(x))
*/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
69934 次 |
| 最近记录: |