Use return STOP or return STOP(returnValue) to stop iteration in callback functions, like map, filter, take etc.
The STOP(returnValue) (experimental), where returnValue is included as the last item of the iteration. @todo(444): test it's projecting the value through any possible options.map
Can be used everywhere (each, filter, take as well as map, reduce etc).
for boolean returning callbacks (eg filter returning false only filters/rejects current item), to stop the iteration.
for value returning callbacks (eg reduce, map), You can either stop with return STOP (without calling it), or return STOP(someValue) to provide the last value of the mapping. @todo(444): test this
Use
return STOP
orreturn STOP(returnValue)
to stop iteration in callback functions, likemap
,filter
,take
etc.The
STOP(returnValue)
(experimental), wherereturnValue
is included as the last item of the iteration. @todo(444): test it's projecting the value through any possibleoptions.map
Can be used everywhere (
each
,filter
,take
as well asmap
,reduce
etc).filter
returningfalse
only filters/rejects current item), to stop the iteration.reduce
,map
), You can either stop withreturn STOP
(without calling it), orreturn STOP(someValue)
to provide the last value of the mapping. @todo(444): test this