Everything is a Stream - Rob Wormald

Top End Devs · 19K views · 2015 · 1:25:01

Open on YouTube

Web developmentFunctional programmingtalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering Angular 2 questions about Observables, HTTP streams and subscriptions, since it comes from an Angular core team member and is referenced in the Angular docs.

Recommended by 3 people across 3 different months, 2015 to 2016.

What it is

A conference-style talk by Rob Wormald of the Angular team explaining what Observables are, how Angular 2 builds on RxJS and reactive programming, and how to use them in apps. It runs about an hour and a half and was recorded in late 2015, during the Angular 2 beta period.

What people said

Strong rec MSwehli · 2016-04 · Stack Overflow · on “Angular 2 - undefinded when sharing variable with API data between component”

Will edit the answer above in a bit to show an example hopefully, in the mean time however i'd highly recommend this video (which is recommended within the angular2 docs themselves) [this video]

Recommends Eric Martinez · 2015-12 · Stack Overflow · on “Prevent memory leaks in Angular 2?”

Check out this hangout talk [this video] as well (min 27:40), it doesn't go deep on the subject, but I was curious about it because of your question and found out that video.

Recommends Günter Zöchbauer · 2016-03 · Stack Overflow · on “Angular 2 Official Tutorial - Promise.resolve VS http”

See for example [LINK] (Angular2 uses RxJS 5) or [this video] for more details. There are lots of docs out there. Angular just uses RxJS and works well with it. RxJS is not part of Angular though.

Cites Thierry Templier · 2016-03 · Stack Overflow · on “Angular 2 Using Observable.debounce() with Http.get”

The debounceTime allows to buffer events and only handle the last one after an amount of time. It's useful in the context of inputs but it should be defined on the observable that triggers the event not on the one created for the HTTP request. Here is a example on a control associated with an input that leverages the debounceTime operator: @Component({ (...) template: ` <input [ngFormControl]="ctrl"/> ` }) export class MyComponent { constructor() { this.ctrl = new Control(); this.ctrl.valueChanges .debounceTime(500) .distinctUntilChanged() .switchMap((value: string) => { // Get data according to the filled value return this.service.getData(entry); }) .subscribe(data => { // Update the linked

Cites seangwright · 2016-12 · Stack Overflow · on “Angular/RxJS When should I unsubscribe from `Subscription`”

TL;DR For this question there are two kinds of Observables - finite value and infinite value. http Observables produce finite (1) values and something like a DOM event listener Observable produces infinite values. If you manually call subscribe (not using async pipe), then unsubscribe from infinite Observables. Don't worry about finite ones, RxJs will take care of them. Sources: I tracked down an answer from Rob Wormald in Angular's Gitter here [LINK] . He states (I reorganized for clarity and emphasis is mine): if its a single-value-sequence (like an http request) the manual cleanup is unnecessary (assuming you subscribe in the controller manually) i should say "if its a sequence that compl