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

TimeoutInfo.lastValue is null when it shouldn't be #7324

Open
cyber-barrista opened this issue Aug 18, 2023 · 0 comments
Open

TimeoutInfo.lastValue is null when it shouldn't be #7324

cyber-barrista opened this issue Aug 18, 2023 · 0 comments
Labels
AGENDA ITEM Flagged for discussion at core team meetings

Comments

@cyber-barrista
Copy link

Describe the bug

TimeoutInfo is an object that is passed to the with callback of TimeoutConfig (timeout operator's config object). It has lastValue field which seems to be null regardless of what was the last value emitted before the timeout occurred.

Expected behavior

lastValue is expected to contain a value emitted right before the timeout firing.

Reproduction code

import { interval, concat, take, EMPTY, timeout } from 'rxjs';

const fast = interval(10).pipe(take(5));
const slow = interval(1000).pipe(take(5));

const replacement = info => {console.log(info); return EMPTY }

const withTimeout = concat(fast, slow).pipe(timeout({each: 500, with: replacement}))

withTimeout.subscribe(console.log);

Reproduction URL

No response

Version

7.8.1

Environment

Browser (V8)

Additional context

Looks like this line

lastValue = null;
is the one to blame

@jakovljevic-mladen jakovljevic-mladen added the AGENDA ITEM Flagged for discussion at core team meetings label Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AGENDA ITEM Flagged for discussion at core team meetings
Projects
None yet
Development

No branches or pull requests

2 participants