-
-
Notifications
You must be signed in to change notification settings - Fork 727
docs: onCancel #2024
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
docs: onCancel #2024
Conversation
|
""" WalkthroughThe documentation has been updated to include a new section detailing the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
docs/upgrade-to-v4.mdx (3)
173-181
: AddonCancel
to the global lifecycle hooks overview
While the new### onCancel
section clearly documents how to use the hook, the Global lifecycle hooks snippet above (lines 104–122) still only listsonStart
,onSuccess
, andonFailure
. For consistency, consider addingonCancel
there so users see it in the high-level hook index before diving into the dedicated section.
183-235
: Clarify hook registration scope and callback signature
The example showstasks.onCancel
being registered inside arun
function, which may be misunderstood as a global hook but actually only applies to that run. Consider adding a brief note that hooks added withinrun
are scoped per-run. Also, to keep callback signatures consistent with other hooks, prefer destructuring the arguments (e.g.tasks.onCancel(({ ctx, signal }) => { … })
) instead of a zero-arity callback.
237-270
: EnhancerunPromise
example with full signature and error handling
To mirror the other hook patterns, destructure bothsignal
andrunPromise
in the callback (e.g.async ({ signal, runPromise }) => { … }
). It would also be helpful to demonstrate handling a rejectedrunPromise
(wrapawait runPromise
in try/catch) to avoid unhandled rejections. Lastly, add a comma in the note for clarity:
“After that point, the process will be killed.” → “After that point, the process will be killed.”
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/upgrade-to-v4.mdx
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript-typescript)
Summary by CodeRabbit
onCancel
lifecycle hook, including usage examples and integration with asynchronous operations.runPromise
parameter.runPromise
within theonCancel
hook.