refactor: inline assignment with return
This commit is contained in:
parent
1eef75513f
commit
64a305f3b5
1 changed files with 4 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue