INNER CODE UNIT · JavaScript

timeout

albertincx/formatbot1 · src/api/utils/index.js:28

function timeout(s, f) {
  const tm = r =>
    setTimeout(() => {
      if (f) {
        f();
      }
      r(true);
    }, s * 1000);
  return new Promise(r => tm(r));
}

function checkData(data, msg = 'missing data') {
  if (data) {
    throw Error(msg);
  }
}

function parseEnvArray(name = '') {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…