How to use cancelable-promise - 1 common examples

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

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

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 2 months ago

Package Health Score

84 / 100
Full package analysis

Popular cancelable-promise functions