This lesson is for PRO members.

Unlock this lesson NOW!
Already subscribed? sign in

Split an RxJS observable with window

6:58 RxJS lesson by

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 take a first order observable and return a higher order Observable. In this lesson we will learn about window, an operator to split an observable.

Get the Code Now
click to level up

egghead.io comment guidelines

Avatar
egghead.io

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 take a first order observable and return a higher order Observable. In this lesson we will learn about window, an operator to split an observable.

Avatar
Sen

Can you please explain how this operator differs from buffer operator?

In reply to egghead.io
Avatar
Andre

Hi Sen. Check out the official docs (which I wrote): http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-window

[buffer] collects values from the past as an array, and emits that array only when another Observable emits.

[window] is like buffer, but emits a nested Observable instead of an array.

In reply to Sen
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?