Skip to content

Commit

Permalink
refactor: rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed May 2, 2023
1 parent 13c0869 commit 9faf673
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/cli/src/spinner.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ const stats = () => {
}

const spinner = createSpinner(stats(), { color: 'white' })
let timer
let interval

const start = () => {
console.log()
spinner.start(stats())
timer = setInterval(() => {
spinner.update({ text: stats() })
}, TICK_INTERVAL)
spinner.start({ text: stats() })
interval = setInterval(() => spinner.update({ text: stats() }), TICK_INTERVAL)
}

const stop = ({ result, force = false } = {}) => {
Expand All @@ -36,7 +34,7 @@ const stop = ({ result, force = false } = {}) => {
spinner.success({ text })
}
procStats.destroy()
clearInterval(timer)
clearInterval(interval)
}

module.exports = {
Expand Down

0 comments on commit 9faf673

Please sign in to comment.