Skip to content

Commit

Permalink
fix: remove state.delta from throttle condition
Browse files Browse the repository at this point in the history
  • Loading branch information
verekia committed Oct 15, 2024
1 parent 7b85a9c commit 8ea0be1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/main-loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const addMainLoopEffect = (
const lastExecution = callbackLastExecutions.get(callback) || 0
const throttleInterval = options?.throttle || 0

if (state.time - lastExecution >= throttleInterval + state.delta) {
if (state.time - lastExecution >= throttleInterval) {
state.deltaWithThrottle = (state.time - lastExecution) / 1000

callbackLastExecutions.set(callback, state.time)
Expand Down

0 comments on commit 8ea0be1

Please sign in to comment.