💌 I create something new each week!
Learn Reactive Programming and stay tuned.
First, learn about take and stream completion.
▬ 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 returns a new stream of at most amount values:
Note: the last values are delivered as several separate event values.