Skip to content

Does shareReplay's teardown function get called? #3127

@andrewkshim

Description

@andrewkshim

RxJS version:
5.5.2

Code to reproduce:
This is more of a question so I don't have a reproducible example.

Expected behavior:
Same as above.

Actual behavior:
Same as above.

Additional information:
At first, I encountered what I thought was a bug with the shareReplay operator, but after finding an older issue that brought up the same concerns, I discovered that it was a misunderstanding on my part about how shareReplay was supposed to work.

However, in the process, I dug through some of the source code and now I have a question about the teardown logic in the shareReplay operator:

https://github.com/ReactiveX/rxjs/blob/e159578eda80a96bb68b83418f503428cc23aa7f/src/operators/shareReplay.ts#L43...L49

Since the shareReplay operator does not create its own Subscriber, it looks like that teardown logic isn't getting attached to anything. Will the teardown logic ever get called?

Thanks for all the hard work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions