#31 : Rename onValueChange -> onProgressValueChange

This commit is contained in:
Vadim
2021-07-03 22:40:30 +03:00
parent 1cca2162ac
commit 04d155823c
2 changed files with 5 additions and 5 deletions

View File

@@ -134,7 +134,7 @@
let progressValue
const progressManager = new ProgressManager({
autoplayDuration,
onValueChange: (value) => {
onProgressValueChange: (value) => {
progressValue = 1 - value
}
})

View File

@@ -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()