Skip to content

Commit

Permalink
fix: throttled action bad logic (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Steven E Wright <StevenEWright@users.noreply.github.com>
  • Loading branch information
StevenEWright committed Aug 28, 2023
1 parent 4b4b700 commit b17eaf8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"website:dev": "npm run website:gendev && cd ./docs/ && web-dev-server --app-index ./index.html --node-resolve --open",
"document": "npm run document:gen && cd ./docs/ && web-dev-server --app-index ./index.html --node-resolve --open",
"document:dev": "npm run document:gendev && cd ./docs/ && web-dev-server --app-index ./index.html --node-resolve --open",
"document:gen": "node generatePackageMetadata.js && typedoc ./src/index.ts --disableSources --darkHighlightTheme solarized-dark --lightHighlightTheme solarized-dark --titleLink \"/modules.html\"",
"document:gen": "node generatePackageMetadata.js && typedoc ./src/index.ts --darkHighlightTheme solarized-dark --lightHighlightTheme solarized-dark --titleLink \"/modules.html\"",
"document:gendev": "node generatePackageMetadata.js && typedoc ./src/docs_index.ts --excludePrivate false --darkHighlightTheme solarized-dark --lightHighlightTheme solarized-dark --titleLink \"/modules.html\"",
"size": "size-limit",
"lint:ts": "eslint ./src/**/*.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/internals/utils/throttled_action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ export class ThrottledAction {
// Reset the state.
clearTimeout(this.timeout);
this.timeout = undefined;
this.shouldExecuteAfterDelay = false;
// After the delay, check if there was another trigger during the delay window.
if (this.shouldExecuteAfterDelay) {
this.trigger();
}
this.shouldExecuteAfterDelay = false;
}, this.delay);
}
}
Expand Down

0 comments on commit b17eaf8

Please sign in to comment.