function waitForWasm(callbackFn, waitTimeMs = 30000, stepTimeMs = 100) {
  if (squiggles) callbackFn(true);

  let timeSpentMs = 0;
  const interval = setInterval(() => {
    const limitReached = timeSpentMs > waitTimeMs;
    if (squiggles || limitReached) {
      clearInterval(interval);
      return callbackFn(!limitReached);
    } else {
      timeSpentMs += stepTimeMs;
    }
  }, stepTimeMs);
}
/**
 *  Here we will check from time to time if we can access the Squiggles
 *  functions. We will return in a callback if it has been resolved
 *  well (true) or if there has been a timeout (false).
 */
Here we will check from time to time if we can access the Squiggles
functions. We will return in a callback if it has been resolved
well (true) or if there has been a timeout (false).
Here we will check from time to time if we can access the Squiggles functions . We will return in a callback if it has been resolved well ( true ) or if there has been a timeout ( false ) .
function waitForWasm(callbackFn, waitTimeMs = 30000, stepTimeMs = 100) {
  if (squiggles) callbackFn(true);
  let timeSpentMs = 0;
  const interval = setInterval(() => {
    const limitReached = timeSpentMs > waitTimeMs;
    if (squiggles || limitReached) {
      clearInterval(interval);
      return callbackFn(!limitReached);
    } else {
      timeSpentMs += stepTimeMs;
    }
  }, stepTimeMs);
}
function waitForWasm ( callbackFn , waitTimeMs = 30000 , stepTimeMs = 100 ) { if ( squiggles ) callbackFn ( true ) ; let timeSpentMs = 0 ; const interval = setInterval ( ( ) => { const limitReached = timeSpentMs > waitTimeMs ; if ( squiggles || limitReached ) { clearInterval ( interval ) ; return callbackFn ( ! limitReached ) ; } else { timeSpentMs += stepTimeMs ; } } , stepTimeMs ) ; }
Here we will check from time to time if we can access the Squiggles
  functions.
Here we will check from time to time if we can access the Squiggles functions .