function _orParallel()

in packages/sqrl/src/function/BoolFunctions.ts [178:199]


    function _orParallel(state, ...promises) {
      return new Promise((resolve) => {
        let remaining = promises.length;
        let hadNull = false;
        for (const promise of promises) {
          promise.then((result) => {
            if (resolve && SqrlObject.isTruthy(result)) {
              resolve(true);
              resolve = null;
            } else {
              if (result === null) {
                hadNull = true;
              }
              remaining -= 1;
              if (remaining === 0) {
                resolve(hadNull ? null : false);
              }
            }
          });
        }
      });
    },