Skip to content

Commit 1df8b81

Browse files
fix(overmind): fix throttle operator
1 parent 09e169d commit 1df8b81

File tree

1 file changed

+2
-4
lines changed
  • packages/node_modules/overmind/src

1 file changed

+2
-4
lines changed

packages/node_modules/overmind/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,6 @@ export function throttle<Input, ThisConfig extends IConfiguration = Config>(
15111511
ms: number
15121512
): IOperator<ThisConfig, Input, Input> {
15131513
let timeout
1514-
let previousFinal
15151514

15161515
return createOperator(
15171516
'throttle',
@@ -1520,14 +1519,13 @@ export function throttle<Input, ThisConfig extends IConfiguration = Config>(
15201519
if (err) next(err, value)
15211520
else {
15221521
if (timeout) {
1523-
previousFinal(null, value)
1522+
final(null, value)
15241523
} else {
1524+
next(null, value)
15251525
timeout = setTimeout(() => {
15261526
timeout = null
1527-
next(null, value)
15281527
}, ms)
15291528
}
1530-
previousFinal = final
15311529
}
15321530
}
15331531
)

0 commit comments

Comments
 (0)