fix init for componentState
This commit is contained in:
parent
0f64215f17
commit
45d480b03d
1 changed files with 15 additions and 15 deletions
|
|
@ -54,21 +54,6 @@
|
|||
showDebugInfo = false,
|
||||
}: Props = $props();
|
||||
|
||||
let componentState = $derived.by(() => ({
|
||||
progress,
|
||||
mappedProgress,
|
||||
easedProgress: easedProgress.current,
|
||||
direction,
|
||||
mappedStart,
|
||||
mappedEnd,
|
||||
triggerStops: scrubbed ? stops : divisions,
|
||||
stops: stops,
|
||||
handleScroll,
|
||||
scrubbed,
|
||||
easing: ease,
|
||||
duration,
|
||||
}));
|
||||
|
||||
let easedProgress: Tween<number> = $state(
|
||||
new Tween(mappedStart, { duration, easing: ease })
|
||||
);
|
||||
|
|
@ -102,6 +87,21 @@
|
|||
return translate;
|
||||
});
|
||||
|
||||
let componentState = $derived.by(() => ({
|
||||
progress,
|
||||
mappedProgress,
|
||||
easedProgress: easedProgress.current,
|
||||
direction,
|
||||
mappedStart,
|
||||
mappedEnd,
|
||||
triggerStops: scrubbed ? stops : divisions,
|
||||
stops: stops,
|
||||
handleScroll,
|
||||
scrubbed,
|
||||
easing: ease,
|
||||
duration,
|
||||
}));
|
||||
|
||||
onMount(() => {
|
||||
// Initialize mappedProgress to mappedStart on mount
|
||||
mappedProgress = mappedStart;
|
||||
|
|
|
|||
Loading…
Reference in a new issue