ReactiveX/rxjs

TimeoutInfo.lastValue is null when it shouldn't be

cyber-barrista opened this issue · 0 comments

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