Conversation
- Implemented `finally` method to allow users to register a callback that runs after the wrapped function finishes, regardless of success or failure. - Updated README to include usage example for the new feature. - Added tests to verify the execution of the `finally` callback on both successful and erroneous function executions. Signed-off-by: w01fgang <sumin@unix-center.ru>
Signed-off-by: w01fgang <sumin@unix-center.ru>
|
Caution Review failedThe pull request is closed. WalkthroughThe changes introduce a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant TryInstance
participant WrappedFunction
participant FinallyCallback
User->>TryInstance: .finally(callback)
User->>TryInstance: .unwrap() / .value()
TryInstance->>WrappedFunction: execute()
WrappedFunction-->>TryInstance: result or error
TryInstance->>FinallyCallback: invoke callback
FinallyCallback-->>TryInstance: (callback completes)
TryInstance-->>User: return result or throw error
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate Unit Tests
🪧 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 (
|
… error handling logic. Signed-off-by: w01fgang <sumin@unix-center.ru>
… handling - Updated the test case to utilize the `unwrap` method instead of `value`. - Adjusted the expectation to check for rejection with the correct error message. Signed-off-by: w01fgang <sumin@unix-center.ru>
Summary by CodeRabbit
New Features
Promise.prototype.finally.Documentation
.finally()method.Tests
Chores