#45 : Add const
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import { setIntervalImmediate } from './interval'
|
import { setIntervalImmediate } from './interval'
|
||||||
|
|
||||||
const STEP_MS = 35
|
const STEP_MS = 35
|
||||||
|
const MAX_VALUE = 1
|
||||||
|
|
||||||
export class ProgressManager {
|
export class ProgressManager {
|
||||||
#autoplayDuration
|
#autoplayDuration
|
||||||
#onProgressValueChange
|
#onProgressValueChange
|
||||||
@@ -32,7 +34,7 @@ export class ProgressManager {
|
|||||||
const value = progress / this.#autoplayDuration
|
const value = progress / this.#autoplayDuration
|
||||||
this.#onProgressValueChange(value)
|
this.#onProgressValueChange(value)
|
||||||
|
|
||||||
if (value > 1) {
|
if (value > MAX_VALUE) {
|
||||||
this.reset()
|
this.reset()
|
||||||
await onFinish()
|
await onFinish()
|
||||||
resolve()
|
resolve()
|
||||||
@@ -51,6 +53,6 @@ export class ProgressManager {
|
|||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
clearInterval(this.#interval)
|
clearInterval(this.#interval)
|
||||||
this.#onProgressValueChange(1)
|
this.#onProgressValueChange(MAX_VALUE)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user