INNER CODE UNIT · TypeScript

Promise

aelassas/movinin · packages/currency-converter/index.ts:532

        return new Promise((resolve, reject) => {
          Convert(this.currencyAmount).from(this.currencyFrom).to(this.currencyTo)
            .then((res) => resolve(res))
            .catch((err) => reject(err))
        })
          .then((rates: unknown) => {
            const ratesNum = rates as number / this.currencyAmount
            if (this.isRatesCaching) {
              this.addRateToRatesCache(currencyPair, ratesNum)
            }
            return ratesNum
          })
      }
    }
  }

  convert(currencyAmount?: number) {
    if (currencyAmount !== undefined) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…