Skip to content

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

Open
@cyber-barrista

Description

@cyber-barrista

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    AGENDA ITEMFlagged for discussion at core team meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions