Skip to content

Commit

Permalink
fix: var declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Mar 31, 2024
1 parent 0eca72c commit 2335afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/useSpring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export function useSpring<T extends MaybeRefOrGetter<SpringValue>>(
let wasAnimating = false
let prevTime = 0
let accumulatedTime = 0
let animationId: number | void | undefined | null

watch(
realValues,
Expand Down Expand Up @@ -113,7 +114,6 @@ export function useSpring<T extends MaybeRefOrGetter<SpringValue>>(
animate()
}

let animationId: number | void | undefined | null
// TODO: also cancel when a new value comes
onScopeDispose(() => {
if (animationId) {
Expand Down Expand Up @@ -155,7 +155,7 @@ export function useSpring<T extends MaybeRefOrGetter<SpringValue>>(
}

if (accumulatedTime === 0) {
// no need to cancel animationID here; shouldn't have any in flight
// no need to cancel animationId here; shouldn't have any in flight
animationId = null
// TODO: emit
// this.$emit('motion-restart')
Expand Down

0 comments on commit 2335afe

Please # to comment.