Skip to content

Commit

Permalink
feat(throttleFilter): leading fix (vitest-dev#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
harmyderoman committed Dec 12, 2021
1 parent b995216 commit 496dbd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/utils/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function throttleFilter(ms: MaybeRef<number>, trailing = true, leading =
if (preventLeading) preventLeading = false
else invoke()
}
else if (trailing) {
if (trailing) {
timer = setTimeout(() => {
lastExec = Date.now()
if (!leading) preventLeading = true
Expand Down

0 comments on commit 496dbd9

Please sign in to comment.