Skip to content

solution#1535

Open
yarovskiy-a wants to merge 2 commits into
mate-academy:masterfrom
yarovskiy-a:develop
Open

solution#1535
yarovskiy-a wants to merge 2 commits into
mate-academy:masterfrom
yarovskiy-a:develop

Conversation

@yarovskiy-a
Copy link
Copy Markdown

Created 2 promises promises 1 and promise 2.
https://yarovskiy-a.github.io/js_promise_basic_DOM/

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your implementation has critical gaps that violate the task requirements. The .then() handler for promise2 (lines 14-16) is empty and must append <div class="message">Promise was resolved!</div> to the body when promise2 resolves. Similarly, the .catch() handler for promise1 (lines 11-13) is empty (only a comment) and must append <div class="message error-message">Promise was rejected!</div> when promise1 is rejected. The requirements explicitly state that both promises need both success and error handlers that perform DOM manipulation. Additionally, the unused thisIs div creation at lines 5-8 is dead code that should be removed. Once these handlers are properly implemented, your promise logic is sound and the core structure is correct.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/scripts/main.js Outdated
Comment on lines +5 to +8
const thisIs = document.createElement('div');

thisIs.className = 'message';
thisIs.innerText = 'Promise was resolved!';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is dead code - the created div is never appended to the body. Either use it or remove it.

Comment thread src/scripts/main.js Outdated
Comment on lines +42 to +43
promise2
.then(() => {})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The .then() handler is empty - according to the requirements, this should append a <div class="message">Promise was resolved!</div> to the body when promise2 resolves.

Comment thread src/scripts/main.js Outdated
Comment on lines +31 to +33
})
.catch(() => {
// ерорщина
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The .catch() handler is empty (only has a comment). According to the requirements, this should append a <div class="message error-message">Promise was rejected!</div> to the body when promise1 is rejected.

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Your implementation successfully meets all task requirements. Both promise1 and promise2 are correctly defined with proper resolution/rejection logic, and all four handlers (.then() and .catch() for each promise) are implemented and working as expected. The code is clean and well-organized with reusable helper functions for displaying messages.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants