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

Rename window to windowWith #5296

Open
benlesh opened this issue Feb 6, 2020 · 6 comments
Open

Rename window to windowWith #5296

benlesh opened this issue Feb 6, 2020 · 6 comments
Assignees
Labels
help wanted Issues we wouldn't mind assistance with.

Comments

@benlesh
Copy link
Member

benlesh commented Feb 6, 2020

We need to deprecate window, because it was a really dumb name, and rename it to windowWith or the like. I suggest windowWith just out of the spirit of concatWith and mergeWith renames... But I'm open to suggestions.

Related: #3788

@benlesh benlesh added the AGENDA ITEM Flagged for discussion at core team meetings label Feb 6, 2020
@benlesh
Copy link
Member Author

benlesh commented Feb 6, 2020

Similarly, we might want to rename buffer to bufferWith because they're closely related.

@benlesh benlesh added help wanted Issues we wouldn't mind assistance with. and removed AGENDA ITEM Flagged for discussion at core team meetings labels Feb 12, 2020
@BioPhoton
Copy link
Contributor

Is there a concept for a counter part?
if 'With' is used to relate to a operator.
E. g. mergeWith. merge would be the counter part.
this obviously doesn't work for window.

The real problem is the basenaming window.

I suggest take a new name.
windows? slice? span?

@benlesh
Copy link
Member Author

benlesh commented Apr 21, 2021

I don't even like the name I had here anymore.

Core Team Notes: Ben is dumb. This isn't a good name, and he shouldn't name things.

@raymonddavis
Copy link

Why not remove it? It appears to me that windowWhen does the same thing? Is there a difference other than typing?

@shees-usman
Copy link

I would suggest either using partitionWith or sliceWith since I assume with is used to identify that this operation is with another observable emission. Partition already is used to make one stream into two based on some condition, partition could be used to partition it into multiple streams with the trigger being the emitting stream.

@yunuseon
Copy link

yunuseon commented Nov 5, 2024

@shees-usman I like both suggestions however I see a small issue with both:

  • partition: RxJS used to have partition both as an operator and a creation function. Both of these referred to partitioning streams into two parts. This could be confusing both for people that still remember the old functions and people ending up reading documentation for deprecated operators by mistake.
  • slice: In principal I like slice but I think it does not imply a continuous operator but one similiar to count which only is done on completion of the stream.

I would suggest using segment. It would fit every current window operator:

  • window -> segment
  • windowCount -> segmentCount
  • windowTime -> segmentTime
  • windowToggle -> segmentToggle
  • windowWhen -> segmentWhen

Edit: Small correction, the creation function partition is not deprecated, so partition is a no-go to begin with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues we wouldn't mind assistance with.
Projects
None yet
Development

No branches or pull requests

5 participants