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.11.2 docs/.vuepress/utils.js
urbanopt-reporting-0.10.1 docs/.vuepress/utils.js
urbanopt-reporting-0.10.0 docs/.vuepress/utils.js
urbanopt-reopt-0.11.0 docs/.vuepress/utils.js
urbanopt-scenario-0.11.0 docs/.vuepress/utils.js
urbanopt-reporting-0.9.1 docs/.vuepress/utils.js
urbanopt-geojson-0.11.1 docs/.vuepress/utils.js
urbanopt-reporting-0.9.0 docs/.vuepress/utils.js
urbanopt-geojson-0.11.0 docs/.vuepress/utils.js
urbanopt-reopt-0.10.0 docs/.vuepress/utils.js
urbanopt-scenario-0.10.0 docs/.vuepress/utils.js
urbanopt-reporting-0.8.0 docs/.vuepress/utils.js
urbanopt-geojson-0.10.0 docs/.vuepress/utils.js
urbanopt-reopt-0.9.0 docs/.vuepress/utils.js
urbanopt-scenario-0.9.0 docs/.vuepress/utils.js
urbanopt-geojson-0.9.0 docs/.vuepress/utils.js
urbanopt-reporting-0.7.0 docs/.vuepress/utils.js
urbanopt-reporting-0.6.2 docs/.vuepress/utils.js
urbanopt-reporting-0.6.1 docs/.vuepress/utils.js
urbanopt-geojson-0.8.1 docs/.vuepress/utils.js