reverse
Returns the source in reverse order.
Lecture
reverse yields a source's elements last-to-first. Like
takeRight and dropRight, there's no way to know
what "last" means without first seeing everything, so reverse
materializes the whole source into a list before it
yields a single value. It's an operator for finite, bufferable sources —
it will never terminate on an infinite one.
reverseAsync follows the same rule: it awaits every element
of the upstream first, then replays them back to front. If you only need
the tail of a sequence rather than a true reversal, prefer
takeRight — it materializes too, but at least stops as soon
as it has the values it needs to output in order.
Demo 1 · Basics
Demo 2 · Async (must buffer the whole source first)
Try it yourself
Exercise: reverse the history so the most recent visit comes first.