Skip to content

docs: fix doc issue #46542#47105

Closed
ileil wants to merge 1 commit intoangular:mainfrom
ileil:lei_bug_fix
Closed

docs: fix doc issue #46542#47105
ileil wants to merge 1 commit intoangular:mainfrom
ileil:lei_bug_fix

Conversation

@ileil
Copy link
Contributor

@ileil ileil commented Aug 10, 2022

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • [x ] Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #46542

What is the new behavior?

Under "Starting the request", added the following note:

You should always unsubscribe from an observable when a component is destroyed. You can use the AsyncPipe to subscribe to and unsubscribe from an observable automatically.

Does this PR introduce a breaking change?

  • Yes
  • [x ] No

Other information

@mary-poppins
Copy link

You can preview d61f1ec at https://pr47105-d61f1ec.ngbuilds.io/.

Copy link
Contributor

@josmar-crwdstffng josmar-crwdstffng left a comment

Choose a reason for hiding this comment

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

@ileil
The update looks good, I added one suggestion.

<div class="alert is-helpful">

The [`AsyncPipe`](api/common/AsyncPipe) subscribes and unsubscribes for you automatically.
You should always unsubscribe from an observable when a component is destroyed. You can use the [`AsyncPipe`](api/common/AsyncPipe) to subscribe to and unsubscribe from an observable automatically.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
You should always unsubscribe from an observable when a component is destroyed. You can use the [`AsyncPipe`](api/common/AsyncPipe) to subscribe to and unsubscribe from an observable automatically.
You should always unsubscribe from an observable when a component is destroyed. Use the [`AsyncPipe`](api/common/AsyncPipe) to automatically subscribe to and unsubscribe from an observable.

@ngbot ngbot bot added this to the Backlog milestone Aug 10, 2022
@jessicajaniuk jessicajaniuk added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Aug 10, 2022
<div class="alert is-helpful">

The [`AsyncPipe`](api/common/AsyncPipe) subscribes and unsubscribes for you automatically.
You should always unsubscribe from an observable when a component is destroyed. You can use the [`AsyncPipe`](api/common/AsyncPipe) to subscribe to and unsubscribe from an observable automatically.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to propose that we drop the sentence about the AsyncPipe. I've looked at the guide at https://angular.io/guide/http and this note is a bit confusing, since it's outside of any relevant context (ideally it should be used in a context of a template and how the subscription is used there).

Suggested change
You should always unsubscribe from an observable when a component is destroyed. You can use the [`AsyncPipe`](api/common/AsyncPipe) to subscribe to and unsubscribe from an observable automatically.
You should always unsubscribe from an observable when a component is destroyed.

@bob-watson
Copy link
Contributor

Re-submitted as #47127

@bob-watson bob-watson closed this Aug 11, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants