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

question about buffer operators #3278

Closed
snackycracky opened this issue Jan 31, 2018 · 10 comments
Closed

question about buffer operators #3278

snackycracky opened this issue Jan 31, 2018 · 10 comments
Assignees

Comments

@snackycracky
Copy link

Hello, why do operators such as bufferWhen that call a users function every time they open a new buffer/window don't let you react to values going through ?
I would like to flush the buffer when some condition on the buffered accumulation is met.

@snackycracky
Copy link
Author

I mean, is there a reason for this design? I am sure it was discussed before.

@benlesh
Copy link
Member

benlesh commented Jan 31, 2018

cc @mattpodwysocki ... bufferWhen is based off of one of behaviors of buffer from RxJS 4 and under. I'm not sure what the rationale was with the design... only how I've used it.

Referring to The Man himself for the design info. 🙌

@snackycracky
Copy link
Author

this question is based on an answer on so: https://stackoverflow.com/q/48526452/170881

@snackycracky
Copy link
Author

@mattpodwysocki ping ping :)

@BioPhoton
Copy link
Contributor

@snackycracky Is your request still relevant?
If not, would you mind closing this issue? If yes please let me know. :)

@snackycracky
Copy link
Author

snackycracky commented Oct 21, 2019

Hey @mattpodwysocki :) what is the design reasoning behind the limitation that operators such as bufferWhen that call a users function every time they open a new buffer/window don't let you react to values going through ?
I would like to flush the buffer when some condition on the buffered accumulation is met.

@BioPhoton
Copy link
Contributor

Hi @snackycracky

Could you provide the condition in the trigger observable?

const fakeSource = of(1,2,42,3,4,2,3,6,42,1,2,3,1,42)
  .pipe(delay(100),share());

const conditionMet = fakeSource.pipe(filter(v => v === 42));
fakeSource.pipe(
  buffer(conditionMet)
).subscribe(x => console.log(x));

Does that help?

@BioPhoton
Copy link
Contributor

Hi @snackycracky!

I tried hard to get your desired answer. I pinged multiple people. And I had to give up on this.
I'm sorry I could not help you further.

If you would be so kind and close this issue and help to keep the number of open issues small.

Best Michael

@snackycracky
Copy link
Author

snackycracky commented Nov 30, 2019 via email

@BioPhoton
Copy link
Contributor

Thanks @snackycracky!

There might be the chance that i meet Matt in 2020 so I can ask.

Other than that I have no chance to figure out the real intentions of Matt and the initial design in rxjs.

Feel free to reopen ask or open a new issue.
🙏

@lock lock bot locked as resolved and limited conversation to collaborators Jan 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants