-
-
Notifications
You must be signed in to change notification settings - Fork 192
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: replace all useEffect
and useCallback
with one useEffect
#862
Conversation
Thank you for your suggestion to group each step into separate functions and call them inside an async IIFE. As mentioned in my last comment, I believe that declaring these functions outside the main I appreciate your patience and help! |
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.
We are almost there, we need to properly handle destruction. All my comments are basically related to this.
I tested your changes and the dispose is no longer working properly.
@kaisalmen First of all thanks for your comments. Also, moving all methods outside the main Lastly, could you please share how you tested the |
@ahmed-s-fatahallah it is this example. It has start and dispose buttons: |
@ahmed-s-fatahallah I have updated all comments and if you use the clean-up function for the |
e310161
to
7688467
Compare
@kaisalmen Thanks a lot for your patience and support, and thanks a lot for this amazing repo 🙏 |
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.
LGTM! Thank you @ahmed-s-fatahallah and sorry for the bumpy ride due to the rebases.
Changes Made:
useEffect
anduseCallback
hooks with a single, cohesiveuseEffect
.Impact:
These adjustments are intended to reduce code complexity, making the lifecycle management of the Monaco editor component more straightforward and maintainable.
Please review these changes and provide any feedback. Thank you!