Cédric Soulas
I make motion graphics with RxJS. I code apps with JavaScript and Elm. I will be available for freelance work from mid-April 2018. Get in touch!

Ep. 30 Get the next episodes Watch all Source on Github

Episode 31 - takeLast vs take Monday, 16 Apr.

This Monday I drew a new card: ❚ takeLast. Let’s compare it with ❚ take:

Use a ▬ number on these cards, such as 3, to set a maximum amount of events to emit. ❚ take and ❚ takeLast share identical behavior:

The stream returned by ❚ take emits the values at the same time as their counterpart on the input stream. This is not the case for ❚ takeLast. Remember: a stream is a sequence of events over time. And we can’t see the future! takeLast must wait for the ◉ complete notification. Only then, we know what are the last values.

takeLast

❚ takeLast returns a new stream of at most amount values:

Note: the last values are delivered as several separate event values.

See also


Episode 9 - take and complete


Episode 10 - take vs last

Ep. 30 Get the next episodes Watch all Source on Github

reactive.how list of animated cards

Learn Reactive Programming

Focus on one new concept – every Monday

Occasional updates, plus:

Cédric Soulas
I make motion graphics with RxJS. I code apps with JavaScript and Elm. I will be available for freelance work from mid-April 2018.