Skip to content

[core-util] Edit delay()#24801

Merged
deyaaeldeen merged 2 commits intoAzure:mainfrom
deyaaeldeen:core-util-delay-edit
Feb 9, 2023
Merged

[core-util] Edit delay()#24801
deyaaeldeen merged 2 commits intoAzure:mainfrom
deyaaeldeen:core-util-delay-edit

Conversation

@deyaaeldeen
Copy link
Copy Markdown
Member

Minor edit to use modern syntax and simpler control flow.

Copy link
Copy Markdown
Member

@jeremymeng jeremymeng left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for the improvement!

@azure-sdk
Copy link
Copy Markdown
Collaborator

API change check

API changes are not detected in this pull request.

Copy link
Copy Markdown
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

I love when the red subtraction number is bigger than the green addition number.

let timer: ReturnType<typeof setTimeout> | undefined = undefined;
let onAborted: (() => void) | undefined = undefined;

const rejectOnAbort = (): void => {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since we're cleaning this up, it might be nicer to have these simply be named functions instead of anonymous ones bound to a local const:

function rejectOnAbort() {

import { isDefined } from "./typeGuards";

const StandardAbortMessage = "The operation was aborted.";
const StandardAbortMessage = "The delay was aborted.";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think some Storage tests at least might be sniffing the message, so you could see some failures with brittle tests. I tried to clean most of that up recently, but fair warning. :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The packages in the CI pipeline seem to be happy but if you come across any such failure, please pass it my way and I will address it.

@deyaaeldeen deyaaeldeen merged commit 00350a6 into Azure:main Feb 9, 2023
@deyaaeldeen deyaaeldeen deleted the core-util-delay-edit branch February 9, 2023 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants