Sometimes you really only need the first item that matches your query, and getting the whole list just adds unnecessary work.
We could optimize this by adding a version of KDBush.range or KDBush.within that instead of returning an array with every single match, are implemented using generators
I'm happy to open a PR :)
Real world example:
maplibre/maplibre-gl-js#6192 (comment)