Rxjs: finalize docs are incomplete

Created on 19 Feb 2019  路  14Comments  路  Source: ReactiveX/rxjs

Documentation Related To Component:

The finalize operator.

Please check those that apply

  • [ ] typo
  • [ ] documentation doesn't exist
  • [x] documentation needs clarification
  • [ ] error(s) in example
  • [x] needs example

Description Of The Issue

The docs state:

Returns an Observable that mirrors the source Observable, but will call a specified function when the source terminates on complete or error.

finalize will also call its callback if the subscriber explicitly unsubscribes. See this test.

The documentation needs an example, too.


Okay. I clearly pasted the wrong link. It's this test.

Help Wanted docs

Most helpful comment

@dzhavat I've added the correct link. (And I've left the mistakenly-pasted link for the amusement of others.)

All 14 comments

@cartant Hilarious :D The this test link points to a tweet of a dog holding two boiled eggs in its mouth 馃槀

@dzhavat I've added the correct link. (And I've left the mistakenly-pasted link for the amusement of others.)

Here is another reproduction of this issue
https://stackblitz.com/edit/rxjs-bsv8sg

HI, can we confirm that indeed finalize calls it's method in case we unsubscribe manually, before observable's execution reached complete / error ?
This is sad that I discovered this issue here :(

@cartant thanks a lot for the link with the dog. It was really nice having this in between all the issue stuff. Haha

Anyway, i will put it on my todo list.

Same behavior observed and discussed here:
https://stackoverflow.com/questions/57696249/rxjs-switchmap-and-tap-issue

IMHO this should deserve attention as it somehow introduce a new hookable "moment" in the lifetime of an observable which is not described yet .

Hi, I'd like to help with this issue.
I have some experience with RxJS with developing Angular applications at my job.
Maybe this is a silly question, but to which branch should the PR of the documentation improvement be targeted? Should it be master or 6.x branch?

@PDavid Please target master. Thanks.

@cartant Thanks, then I'll redo my changes and open a new PR to master.

@PDavid Note that you can rebase your local branch (use git rebase --onto ...), push to the PR and then change the PR's branch to master - a dropdown is made available to do so when you edit the PR's title.

@cartant Thanks for the rebase --onto hint. ;-) I rebased my branch onto master but needed to open a new PR because I already closed the original PR.
How can we move forward with this?
Who can have a look on the PR and provide feedback?

It's in the queue. I can assure you that your work is appreciated, but we are all busy people. I will try to make some time on the weekend to go through the PR backlog.

Sure, thank you! Just wanted to make sure. :)

closed by #5065

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dooreelko picture dooreelko  路  3Comments

matthewwithanm picture matthewwithanm  路  4Comments

chalin picture chalin  路  4Comments

Zzzen picture Zzzen  路  3Comments

benlesh picture benlesh  路  3Comments