RxJS Introduction
MD
R
MarkdownRxJS quick overview based on: https://blog.angularindepth.com/the-best-way-to-unsubscribe-rxjs-observable-in-the-angular-applications-d8f9aa42f6a0
Overview
- RxJS is a tool to manage collections of async events
- Subscribe to event streams
- Event streams can emit 0 or infinite values
- Unsubscriptions need to be managed manually
- Memory leaks can appear due to non unsubscribing
- Multiple ways to unsubscribe (take(1), .unsubscribe(), <ng-container stream$ | async>
- Best to use | async pipe to subscribe and unwrap values in the component templates (with help of <ng-container> element)
Created on 6/25/2019