Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

defaultIfEmpty() not working #938

@manuelfc1

Description

@manuelfc1

When a try to use defaultIfEmpty in a simple example it throws an error:

let emptyArray = [];

let source = Rx.Obsevable.from(emptyArray).defaultIfEmpty();

or

let source = Rx.Obsevable.from(emptyArray).defaultIfEmpty(true);

source.subscribe( (res:any) => console.log(res));

It throws the following error:

ReferenceError: defaultValue is not defined
at DefaultIfEmptyObserver.completed (rx.all.js:5132)
at DefaultIfEmptyObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (rx.all.js:1739)
at DefaultIfEmptyObserver.tryCatcher (rx.all.js:60)
at AutoDetachObserverPrototype.completed (rx.all.js:11674)
at AutoDetachObserver.Rx.internals.AbstractObserver.AbstractObserver.onCompleted (rx.all.js:1739)
at loopRecursive (rx.all.js:2606)
at invokeRecImmediate as action
at ScheduledItem.invokeCore (rx.all.js:955)
at ScheduledItem.invoke (rx.all.js:943)
at runTrampoline (rx.all.js:1182)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions