Skip to content

Commit

Permalink
refactor: remove scheduleAnimation function and replace its usage wit…
Browse files Browse the repository at this point in the history
…h direct calls to animateUpdates in MotionState class
  • Loading branch information
rick-hup committed Jan 9, 2025
1 parent 437d2b5 commit e5a04dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 42 deletions.
5 changes: 2 additions & 3 deletions packages/motion/src/state/motion-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { getOptions, hasChanged, resolveVariant } from '@/state/utils'
import { FeatureManager } from '@/features'
import { style } from '@/state/style'
import { transformResetValue } from '@/state/transform'
import { scheduleAnimation } from '@/state/schedule'
import { motionEvent } from '@/state/event'
import { createVisualElement } from '@/state/create-visual-element'
import { type ActiveVariant, animateVariantsChildren } from '@/state/animate-variants-children'
Expand Down Expand Up @@ -193,7 +192,7 @@ export class MotionState {
this.featureManager.update()

if (hasAnimateChange && !notAnimate) {
scheduleAnimation(this as any)
this.animateUpdates()
}
}

Expand All @@ -205,7 +204,7 @@ export class MotionState {
((child as any).state as MotionState).setActive(name, isActive, false)
})
if (isAnimate) {
scheduleAnimation(this)
this.animateUpdates()
}
}

Expand Down
39 changes: 0 additions & 39 deletions packages/motion/src/state/schedule.ts

This file was deleted.

0 comments on commit e5a04dc

Please sign in to comment.