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