Creates a sink selecting the greatest item of the feed.
Items are ranked in source order, seeding the result with the first one and retaining only the greatest ranking item
seen so far, so selection stays within constant memory whatever the size of the feed, but never completes on an
infinite source; equally ranking items resolve to the first one in source order.
An empty feed resolves to undefined; callers wanting a default supply it with ??. As ascending ranks
null before any other value, a feed resolves to null only if it carries nothing else, unless the comparator
states otherwise.
Tip
The @metreeca/core order module provides helper functions for
assembling complex ranking criteria.
Creates a sink selecting the greatest item of the feed.
Items are ranked in source order, seeding the result with the first one and retaining only the greatest ranking item seen so far, so selection stays within constant memory whatever the size of the feed, but never completes on an infinite source; equally ranking items resolve to the first one in source order.
An empty feed resolves to
undefined; callers wanting a default supply it with??. As ascending ranksnullbefore any other value, a feed resolves tonullonly if it carries nothing else, unless the comparator states otherwise.The @metreeca/core order module provides helper functions for assembling complex ranking criteria.