RxJava has a method toSortedList(Comparator comparator)
that converts a flow of objects into a list of objects sorted by a Comparator.
How can I achieve the same in JavaScript with RxJS and get an Observable with a flow of objects to emit a sorted array/list?