The function to run
An array of delay in milliseconds
a function that will cancel the process if called
if callback is not a function, if timeoutsInMilliseconds is not a non-empty array of number
// Print "Hello World" 4 times then cancel it before printing the last repetition
const myHelloWorldFunction = () => console.log("Hello World")
const stopProcessing = JMap.Util.asyncProcess(myHelloWorldFunction, [1000, 1000, 1000, 1000, 1000])
setTimeout(() => stopProcessing(), 4100)
JMap.Util.asyncProcess
Run the parameter function after one or multiple delays.
You can cancel the repetition by running the function returned by asyncProcess