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

defaultIfEmpty() not working #938

Closed
manuelfc1 opened this issue Sep 29, 2015 · 2 comments
Closed

defaultIfEmpty() not working #938

manuelfc1 opened this issue Sep 29, 2015 · 2 comments

Comments

@manuelfc1
Copy link

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)

@paulpdaniels
Copy link
Contributor

Interesting. Looks like the tests were catching the problem but the test cases weren't included in any f the fixtures.

@jadbox
Copy link

jadbox commented Oct 8, 2015

Please update npm with fix

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants