ReactiveX / ReactiveX/rxjs

debounceTime does not emit when queueScheduler is used

Open
#6,764 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
31.7k
Forks
3k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

If synchronous scheduler is used and there are no other tasks debounceTime does not emit value to subscriber.

Expected behavior

debounceTime should work properly with queueScheduler as it was in v6

expected output

emit!

actual output

No emit at all

Reproduction code
import { BehaviorSubject, queueScheduler } from 'rxjs';
import { debounceTime } from 'rxjs/operators';

const data$ = new BehaviorSubject('emit!');

data$.pipe(debounceTime(0, queueScheduler)).subscribe(console.log);
Reproduction URL

https://stackblitz.com/edit/q7u9jg-hykb4x

Version

7.5.1

Environment

No response

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the debounceTime operator and its queueScheduler path, then run the reproduction code from the issue with RxJS 7.5.1. Confirm that debounceTime(0, queueScheduler) emits emit! from the BehaviorSubject, matching the expected behavior and not the current lack of output.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.