Skip to content

Initialize removeSignalEventListener as an empty function #1351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/unlucky-glasses-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@smithy/fetch-http-handler": patch
---

Initialize removeSignalEventListener as an empty function
2 changes: 1 addition & 1 deletion packages/fetch-http-handler/src/fetch-http-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class FetchHttpHandler implements HttpHandler<FetchHttpHandlerConfig> {
requestOptions.keepalive = keepAlive;
}

let removeSignalEventListener = null as null | (() => void);
let removeSignalEventListener = () => {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let removeSignalEventListener = () => {};
// react-native promises cannot accept non-function as a then/catch/finally step.
let removeSignalEventListener = () => {};

Copy link
Contributor Author

@trivikr trivikr Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the comment is necessary, as this fix changes removeSignalEventListener type to a function?


const fetchRequest = new Request(url, requestOptions);
const raceOfPromises = [
Expand Down
Loading