How to use the cancelable-promise.resolve function in cancelable-promise

To help you get started, we’ve selected a few cancelable-promise examples, based on popular ways it is used in public projects.

github TheThingsNetwork / lorawan-stack / pkg / webui / lib / components / with-locale.js View on Github external
import(/* webpackChunkName: "locale.[request]" */ `intl/locale-data/jsonp/${locale}`),
      )
    }

    if (!window.Intl.PluralRules) {
      log(`Polyfilling Intl.PluralRules`)
      promises.push(import('intl-pluralrules'))
    }

    if (!window.Intl.RelativeTimeFormat) {
      log(`Polyfilling Intl.RelativeTimeFormat data for language ${language}`)
      promises.push(import('@formatjs/intl-relativetimeformat/polyfill'))
      promises.push(import(`@formatjs/intl-relativetimeformat/dist/locale-data/${language}`))
    }

    return CancelablePromise.resolve(Promise.all(promises))
      .then(result => this.success(result, withLocale))
      .catch(this.fail)
  }

cancelable-promise

A simple cancelable promise

MIT
Latest version published 7 months ago

Package Health Score

80 / 100
Full package analysis

Popular cancelable-promise functions