Add Code Mode to New Loop

The new version of the loop block is only able to work on an array from the result of a previous block. This works for most situations, except when polling. In the legacy version you were able to define the whole loop in JS instead of selecting an array:

Since you have to select a data source on the new Loop which contains values you wish to iterate over it's impossible to re-create the loop block above using the old loop with the new version. being able to select 'infinite' for the data source and define a condition to break the loop or re-adding the 'mode' selection for GUI/Code would both solve this, but as it is I'm unable to remove the legacy component

I figured it out. I had to move the api request from the lambda to a function, then I could use 'Run JS Code' for the new loop lambda and call the function from there and process it afterwards.

basically the lambda from the new loop only runs 1 time with a nested loop (my infinite loop above) that sends an api request and checks if the infinite loop should break or continue.