refactor: inline assignment with return
This commit is contained in:
parent
63f40da632
commit
bb57a599e0
1 changed files with 4 additions and 6 deletions
|
|
@ -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 => ({
|
|
||||||
rates: r.rates,
|
|
||||||
timestamp: Date.now()
|
|
||||||
}))
|
|
||||||
.then(r => {
|
.then(r => {
|
||||||
lastRate[market] = r
|
return lastRate[market] = {
|
||||||
return r
|
rates: r.rates,
|
||||||
|
timestamp: Date.now()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
logger.error(err)
|
logger.error(err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue