-
Notifications
You must be signed in to change notification settings - Fork 4.9k
refactor: remove unnecessary await #18248
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
Conversation
Walkthrough在 H5 端 system 接口中,为 getSystemInfoAsync 与 getSystemInfo 增加了明确的 Option 类型注解,并在两者内部调用 getSystemInfoSync 时去掉了 await,改为直接同步调用。其余成功/失败回调与默认值逻辑保持不变。 Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant getSystemInfoAsync
participant getSystemInfoSync
Caller->>getSystemInfoAsync: 调用(options: Taro.getSystemInfoAsync.Option)
Note over getSystemInfoAsync: 参数拥有显式类型
getSystemInfoAsync->>getSystemInfoSync: 同步调用(无 await)
getSystemInfoSync-->>getSystemInfoAsync: 返回系统信息
getSystemInfoAsync-->>Caller: 触发 success/complete 或返回结果
sequenceDiagram
participant Caller
participant getSystemInfo
participant getSystemInfoSync
Caller->>getSystemInfo: 调用(options: Taro.getSystemInfo.Option)
Note over getSystemInfo: 参数拥有显式类型
getSystemInfo->>getSystemInfoSync: 同步调用(无 await)
getSystemInfoSync-->>getSystemInfo: 返回系统信息
getSystemInfo-->>Caller: 触发 success/complete 或返回结果
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
这个 PR 做了什么? (简要描述所做更改)
remove unnecessary await
这个 PR 是什么类型? (至少选择一个)
这个 PR 涉及以下平台:
Summary by CodeRabbit