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,
|
showDebugInfo = false,
|
||||||
}: Props = $props();
|
}: 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(
|
let easedProgress: Tween<number> = $state(
|
||||||
new Tween(mappedStart, { duration, easing: ease })
|
new Tween(mappedStart, { duration, easing: ease })
|
||||||
);
|
);
|
||||||
|
|
@ -102,6 +87,21 @@
|
||||||
return translate;
|
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(() => {
|
onMount(() => {
|
||||||
// Initialize mappedProgress to mappedStart on mount
|
// Initialize mappedProgress to mappedStart on mount
|
||||||
mappedProgress = mappedStart;
|
mappedProgress = mappedStart;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue