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

debounce operator with duration selector #493

Closed
kwonoj opened this issue Oct 9, 2015 · 5 comments
Closed

debounce operator with duration selector #493

kwonoj opened this issue Oct 9, 2015 · 5 comments
Assignees

Comments

@kwonoj
Copy link
Member

kwonoj commented Oct 9, 2015

While trying to migrate test coverage in RxJS4, could observe difference between signature of debounce operator

RxJS4

Rx.Observable.prototype.debounce(dueTime, [scheduler])
Rx.Observable.prototype.debounce(durationSelector)

while current signature only allows first one
debounce<T>(dueTime: number, scheduler: Scheduler = nextTick)

Not sure if this is intended design or not - should operator to be updated, or test coverage for latter can be dropped off?

@benlesh
Copy link
Member

benlesh commented Oct 9, 2015

Hmmm... I tell you what. Examine the level of complexity with supporting both on the same operator. If it incurs too many conditionals, we should probably seperate them into debounce and debounceTime

@kwonoj
Copy link
Member Author

kwonoj commented Oct 9, 2015

It'll also works. Just curious if it was intended.. I'll try to scope out changes and create PR based on those.

@benlesh
Copy link
Member

benlesh commented Oct 9, 2015

Yeah... looking at this, it's probably best to rename what's there to debounceTime and add a debounce operator that takes an Observable as an argument. Likewise, we'll need to do this for throttle and throttleTime ... I'll take a look at that.

@benlesh
Copy link
Member

benlesh commented Oct 9, 2015

What do you think @kwonoj? Do you agree?

@kwonoj
Copy link
Member Author

kwonoj commented Oct 9, 2015

What's interesting is, in case of throttle it didn't had durationSelector, (https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/throttle.md)

Rx.Observable.prototype.throttle(windowDuration, [scheduler])

only. For alignment, I think it makes sense.

kwonoj added a commit to kwonoj/rxjs that referenced this issue Oct 13, 2015
- add debounceTime operator
- expand test coverage including micro perf test

relates to ReactiveX#493
kwonoj added a commit to kwonoj/rxjs that referenced this issue Oct 13, 2015
- add debounce operator accepts durationSelector
- add test coverage as well as micro perf test

closes ReactiveX#493
kwonoj added a commit to kwonoj/rxjs that referenced this issue Oct 13, 2015
- add debounce operator accepts durationSelector
- add test coverage as well as micro perf test

closes ReactiveX#493
benlesh pushed a commit that referenced this issue Oct 13, 2015
- add debounceTime operator
- expand test coverage including micro perf test

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

Successfully merging a pull request may close this issue.

2 participants