ReactiveX / ReactiveX/rxjs

buffer operator emits value on closingNotifier complete

Open
#7,528 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

The buffer operator emits the empty value on closingNotifier completes.

Expected behavior

No value emitted on closingNotifier completes.

Reproduction code
import { fromEvent, interval, buffer, takeUntil, debounceTime } from 'rxjs';

const addItem = fromEvent(document, 'click').pipe(takeUntil(interval(5000)));

const debounce = addItem.pipe(debounceTime(500));
addItem.pipe(buffer(debounce)).subscribe((d) => console.log(d));
Reproduction URL

https://stackblitz.com/edit/rwbsk1a8?devtoolsheight=50&file=index.ts

Version

7.8.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 RxJS buffer operator and run the reproduction from the issue or its StackBlitz URL. Confirm the behavior when the closingNotifier completes, then verify that completion produces no empty emission and add coverage for the reported case.

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
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.