refactor: inline assignment with return

This commit is contained in:
siiky 2023-11-22 18:09:50 +00:00
parent 63f40da632
commit bb57a599e0

View file

@ -22,13 +22,11 @@ function _getRates (settings, fiatCode, cryptoCode) {
const market = [cryptoCode, fiatCode].join('-') const market = [cryptoCode, fiatCode].join('-')
return buildTicker(fiatCode, cryptoCode, tickerName) return buildTicker(fiatCode, cryptoCode, tickerName)
.then(r => ({ .then(r => {
return lastRate[market] = {
rates: r.rates, rates: r.rates,
timestamp: Date.now() timestamp: Date.now()
})) }
.then(r => {
lastRate[market] = r
return r
}) })
.catch(err => { .catch(err => {
logger.error(err) logger.error(err)