-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Refactor Contact class methods to be async #2671
base: main
Are you sure you want to change the base?
Conversation
Important Auto Review SkippedBot user detected. To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Hey @ellipsis, give me a code review |
OK! Reviewing this PR... Responding to this comment by @huan. For more information about Ellipsis, check the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested.
- Reviewed the entire pull request up to 159e84c
- Looked at
50
lines of code in1
files - Took 44 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
0
additional comments because they didn't meet confidence threshold of50%
.
Workflow ID: wflow_iyaOdOeasx1bFvEt
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with review rules, user-specific overrides, quiet
mode, and more. See docs.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
*/ | ||
name (): string { | ||
return (this.payload && this.payload.name) || '' | ||
async name (): Promise<string> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of Promise.resolve
is unnecessary in async functions. You can directly return the value. For example:
async name (): Promise<string> { | |
return (this.payload && this.payload.name) || '' |
This comment applies to the title
and coworker
methods as well.
This pull request makes all public methods in the
Contact
class asynchronous, ensuring consistent use ofawait
in future implementations. Changes include updating method signatures to returnPromise
where applicable and ensuring compatibility with related classes likeContactSelf
. No external behavior of the class has been changed, but the internal handling is now fully asynchronous.Tips:
Summary:
Refactored
Contact
class methodsname
,title
, andcoworker
to be asynchronous, ensuring future compatibility and consistency in handling asynchronous operations.Key points:
Contact
class methods to be asynchronous.name
,title
, andcoworker
methods to returnPromise
.ContactSelf
.Generated with ❤️ by ellipsis.dev