Skip to content
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

Clarify then() handler's lifetime #34872

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Clarify then() handler's lifetime #34872

wants to merge 1 commit into from

Conversation

ikonst
Copy link

@ikonst ikonst commented Jul 16, 2024

Description

Clarifies who retains the handler passed to .then() and its lifetime.

Motivation

Knowing the handler's lifetime is important to ensure the handler is executed, and to prevent memory leaks.

@ikonst ikonst requested a review from a team as a code owner July 16, 2024 17:14
@ikonst ikonst requested review from Josh-Cena and removed request for a team July 16, 2024 17:14
@github-actions github-actions bot added Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed labels Jul 16, 2024
@Josh-Cena
Copy link
Member

Would be interesting to see an example of a leak (or lack of).

Copy link
Contributor

@ikonst
Copy link
Author

ikonst commented Jul 16, 2024

Would be interesting to see an example of a leak (or lack of).

Do you suggest adding to the examples section?

@Josh-Cena
Copy link
Member

Josh-Cena commented Jul 16, 2024

I think an inline one is fine, but if it's like more than 15 lines long, the examples section is better. You can decide here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants