Sha256: 50ed2fcb890e9f65d5a3bb2c96a3032241a4e635bc0116165962b1a9e0ce1dbf

Contents?: true

Size: 464 Bytes

Versions: 94

Compression:

Stored size: 464 Bytes

Contents

export function emptyPromise() {
    let res;
    let rej;
    const p = new Promise((resolve, reject) => {
      res = resolve;
      rej = reject;
    });
    p.pending = true;
    p.resolved = p.rejected = null;
    p.resolve = (...args) => {
      res(...args); p.resolved = true; p.rejected = false; p.pending = false;
    };
    p.reject = (...args) => {
      rej(...args); p.rejected = true; p.resolved = false; p.pending = false;
    };
    return p;
  }

Version data entries

94 entries across 94 versions & 4 rubygems

Version Path
urbanopt-geojson-0.6.2 docs/.vuepress/utils.js
urbanopt-geojson-0.6.1 docs/.vuepress/utils.js
urbanopt-reopt-0.6.0 docs/.vuepress/utils.js
urbanopt-scenario-0.6.0 docs/.vuepress/utils.js
urbanopt-reporting-0.4.0 docs/.vuepress/utils.js
urbanopt-geojson-0.6.0 docs/.vuepress/utils.js
urbanopt-reopt-0.5.7 docs/.vuepress/utils.js
urbanopt-reopt-0.5.6 docs/.vuepress/utils.js
urbanopt-geojson-0.5.3 docs/.vuepress/utils.js
urbanopt-reopt-0.5.5 docs/.vuepress/utils.js
urbanopt-reporting-0.3.7 docs/.vuepress/utils.js
urbanopt-reopt-0.5.4 docs/.vuepress/utils.js
urbanopt-geojson-0.5.2 docs/.vuepress/utils.js
urbanopt-scenario-0.5.1 docs/.vuepress/utils.js
urbanopt-reporting-0.3.6 docs/.vuepress/utils.js
urbanopt-reporting-0.3.5 docs/.vuepress/utils.js
urbanopt-reporting-0.3.4 docs/.vuepress/utils.js
urbanopt-reporting-0.3.3 docs/.vuepress/utils.js
urbanopt-reopt-0.5.0 docs/.vuepress/utils.js
urbanopt-scenario-0.5.0 docs/.vuepress/utils.js