refactor: inline assignment with return

This commit is contained in:
siiky 2023-11-22 18:09:50 +00:00
parent 1eef75513f
commit 64a305f3b5

View file

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