fxValues
The values of a Map, as a plain lazy Iterable — ready to wrap in fx() and chain.
Lecture
fxValues(map) is fxKeys's twin: a thin wrapper
around Dart's map.values, given a name consistent with the
rest of the object-function vocabulary so it reads naturally as
fx(fxValues(map)) next to fx(fxKeys(map)) and
fx(fxEntries(map)). Like map.values itself,
it's already a lazy view — no extra buffering happens.
Because it hands back a plain Iterable<V>, every
chain operator you've learned so far applies directly — including the
numeric terminals (sum(), average(),
min(), max()) when V is a
num. This makes fxValues the natural entry
point for aggregating a Map's data: total up prices, average scores,
find the newest timestamp, and so on.
This is also the last stop before map itself — the next
lesson, and the operator you'll reach for constantly from here on to
reshape whatever fxValues, fxEntries, or any
other source hands you.
Demo 1 · Basics
Demo 2 · Aggregating a Map's values
Try it yourself
Exercise: use fxValues to compute the average score.
fxKeys — the keys of a Map ·
fxEntries — keys and values paired together ·
map — reshape every value in a chain ·
sum · average · min · max — the numeric terminals used above