随笔分类 -  RxJS

摘要:With the shareReplay operator in place, we would no longer fall into the situation where we have accidental multiple HTTP requests. And this covers th 阅读全文
posted @ 2017-08-23 15:52 Zhentiw 阅读(395) 评论(0) 推荐(0)
摘要:.share() is an alias for .publish().refCount(). So if the source is not yet completed, no matter how many subscribers subscribe to the source, they sh 阅读全文
posted @ 2017-05-31 18:27 Zhentiw 阅读(756) 评论(0) 推荐(0)
摘要:Eventually you will feel the need for pausing the observation of an Observable and resuming it later. In this lesson we will learn about use cases whe 阅读全文
posted @ 2017-05-30 14:53 Zhentiw 阅读(318) 评论(0) 推荐(0)
摘要:This lesson will highlight the true purpose of the zip operator, and how uncommon its use cases are. In its place, we will learn how to use the combin 阅读全文
posted @ 2017-05-29 14:33 Zhentiw 阅读(380) 评论(0) 推荐(0)
摘要:Manually unsubscribing from subscriptions is safe, but tedious and error-prone. This lesson will teach us about the takeUntil operator and its utility 阅读全文
posted @ 2017-05-29 14:07 Zhentiw 阅读(245) 评论(0) 推荐(0)
摘要:The use of RxJS Subjects is common, but not without problems. In this lesson we will see how they can be usually safely replaced with plain Observable 阅读全文
posted @ 2017-05-26 19:16 Zhentiw 阅读(198) 评论(0) 推荐(0)
摘要:export class MailFolderComponent implements OnInit{ title: Observable; messages: Observable; constructor( private route: ActivatedRoute ){ } ngOnInit() { this.messages = thi... 阅读全文
posted @ 2017-04-26 03:35 Zhentiw 阅读(512) 评论(0) 推荐(0)
摘要:forkJoin: When all observables complete emit the last value from each. 阅读全文
posted @ 2017-03-21 23:59 Zhentiw 阅读(474) 评论(0) 推荐(0)
摘要:Observable.prototype.debug = function(message: any) { return this.do( (next) => { if(!environment.production) { console.log(message, next); } }, (err) => { ... 阅读全文
posted @ 2017-01-25 17:05 Zhentiw 阅读(342) 评论(0) 推荐(0)
摘要:This lesson will show when to apply groupBy in the real world. This RxJS operator is best suited when a source observable represents many data sources 阅读全文
posted @ 2017-01-18 14:35 Zhentiw 阅读(384) 评论(0) 推荐(0)
摘要:groupBy() is another RxJS operator to create higher order observables. In this lesson we will learn how groupBy works for routing source values into d 阅读全文
posted @ 2016-12-23 02:49 Zhentiw 阅读(310) 评论(0) 推荐(0)
摘要:There are variants of the window operator that allow you to split RxJS observables in different ways. In this lesson we will explore the windowToggle 阅读全文
posted @ 2016-12-22 21:48 Zhentiw 阅读(411) 评论(0) 推荐(0)
摘要:Mapping the values of an observable to many inner observables is not the only way to create a higher order observable. RxJS also has operators that ta 阅读全文
posted @ 2016-12-21 17:31 Zhentiw 阅读(353) 评论(0) 推荐(0)
摘要:Like switchMap and mergeMap, concatMap is a shortcut for map() followed by a concatAll(). In this lesson we will explore this RxJS operator and its pr 阅读全文
posted @ 2016-12-19 21:49 Zhentiw 阅读(670) 评论(0) 推荐(0)
摘要:Like RxJS switchMap() is a shortcut for map() and switch(), we will see in this lesson how mergeMap() is a shortcut for map() and mergeAll(), and lear 阅读全文
posted @ 2016-12-19 21:43 Zhentiw 阅读(404) 评论(0) 推荐(0)
摘要:Besides switch and mergeAll, RxJS also provides concatAll as a flattening operator. In this lesson we will see how concatAll handles concurrent inner 阅读全文
posted @ 2016-12-16 21:04 Zhentiw 阅读(305) 评论(0) 推荐(0)
摘要:Among RxJS flattening operators, switch is the most commonly used operator. However, it is important to get acquainted with mergeAll, another flatteni 阅读全文
posted @ 2016-12-16 20:59 Zhentiw 阅读(298) 评论(0) 推荐(0)
摘要:The idea is when we tape the arrow keys on the keyboard, we want the ball move accodingly. Here, 'curr' is the function return from 'mapTo', the 'acc' 阅读全文
posted @ 2016-12-06 18:23 Zhentiw 阅读(578) 评论(0) 推荐(0)
摘要:As a conclusion to this course about RxJS subjects, let's review when and why should you use them. For certain cases, subjects are absolutely necessar 阅读全文
posted @ 2016-10-26 18:52 Zhentiw 阅读(252) 评论(0) 推荐(0)
摘要:Let's explore a different use of the multicast() operator in RxJS, where you can provide a selector function as a sandbox where the shared Observable 阅读全文
posted @ 2016-10-26 18:44 Zhentiw 阅读(482) 评论(0) 推荐(0)