#31 : Rename onValueChange -> onProgressValueChange
This commit is contained in:
@@ -134,7 +134,7 @@
|
||||
let progressValue
|
||||
const progressManager = new ProgressManager({
|
||||
autoplayDuration,
|
||||
onValueChange: (value) => {
|
||||
onProgressValueChange: (value) => {
|
||||
progressValue = 1 - value
|
||||
}
|
||||
})
|
||||
|
||||
@@ -4,17 +4,17 @@ const PROGRESS_STEPS_COUNT = 100
|
||||
|
||||
export class ProgressManager {
|
||||
#autoplayDuration
|
||||
#onValueChange
|
||||
#onProgressValueChange
|
||||
|
||||
#interval
|
||||
#paused = false
|
||||
|
||||
constructor({
|
||||
autoplayDuration,
|
||||
onValueChange,
|
||||
onProgressValueChange,
|
||||
}) {
|
||||
this.#autoplayDuration = autoplayDuration
|
||||
this.#onValueChange = onValueChange
|
||||
this.#onProgressValueChange = onProgressValueChange
|
||||
}
|
||||
|
||||
start(onFinish) {
|
||||
@@ -30,7 +30,7 @@ export class ProgressManager {
|
||||
progress += stepMs
|
||||
|
||||
const value = progress / this.#autoplayDuration
|
||||
this.#onValueChange(value)
|
||||
this.#onProgressValueChange(value)
|
||||
|
||||
if (value > 1) {
|
||||
this.reset()
|
||||
|
||||
Reference in New Issue
Block a user