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 STOPorreturn STOP(returnValue)to stop iteration in callback functions, likemap,filter,takeetc.The
STOP(returnValue)(experimental), wherereturnValueis included as the last item of the iteration. @todo(444): test it's projecting the value through any possibleoptions.mapCan be used everywhere (
each,filter,takeas well asmap,reduceetc).filterreturningfalseonly 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