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

refactor: add createOperatorSubscriber abstraction #6804

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Feb 7, 2022

Simply hides the creation of new OperatorSubscriber in a function called createOperatorSubscriber.

This is part of a larger plan to:

  1. Productize our internal means of creating operators so other folks can use it. (this is just the first step, I do not plan on exposing createOperatorSubscriber at this time). The idea is to move away from using classes all over our operators for both minification reasons and because then later, when we productize things, we don't have to export classes that people will try to subclass.
  2. Make it easier to refactor the class underpinning our operators by abstracting it away

NOTE: This does not attempt to change anything about the special case in groupBy, which will require some thought.

Related: #6803

Simply hides the creation of `new OperatorSubscriber` in a function called `createOperatorSubscriber`.

This is part of a larger plan to:

1. Productize our internal means of creating operators so other folks can use it. (this is just the first step, I do not plan on exposing `createOperatorSubscriber` at this time). The idea is to move away from using classes all over our operators for both minification reasons and because then later, when we productize things, we don't have to export classes that people will try to subclass.
2. Make it easier to refactor the class underpinning our operators by abstracting it away

NOTE: This does not attempt to change anything about the special case in `groupBy`, which will require some thought.
benlesh added a commit to benlesh/rxjs that referenced this pull request Feb 7, 2022
Adds a special case to `OperatorSubscriber` to support `groupBy`.

Related: ReactiveX#6805 ReactiveX#6803 ReactiveX#6804
@benlesh benlesh added 7.x Issues and PRs for version 7.x 8.x Issues and PRs for version 8.x labels Feb 7, 2022
Copy link
Collaborator

@cartant cartant left a comment

Choose a reason for hiding this comment

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

LGTM. Can we remove the export from export class OperatorSubscriber? (Reviewing this on my phone, so it's not easy to check whether the export is really needed, now.)

@benlesh
Copy link
Member Author

benlesh commented Feb 8, 2022

@cartant not yet, we need to merge #6806 first, and update this a bit.

@benlesh benlesh merged commit 211e6ff into ReactiveX:master Feb 8, 2022
benlesh added a commit that referenced this pull request Feb 8, 2022
Adds a special case to `OperatorSubscriber` to support `groupBy`.

Related: #6805 #6803 #6804
@benlesh benlesh deleted the refactor-hide-operator-subscriber-in-function branch February 8, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7.x Issues and PRs for version 7.x 8.x Issues and PRs for version 8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants