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

Detect observable issues #31

Open
SamVerschueren opened this issue Sep 29, 2016 · 2 comments
Open

Detect observable issues #31

SamVerschueren opened this issue Sep 29, 2016 · 2 comments
Labels

Comments

@SamVerschueren
Copy link
Owner

Due to an issue in is-observable, we have to fall back to duck typing as isObservable() always returns false.

The current implementation.

const isObservable = obj => Boolean(obj && typeof obj.subscribe === 'function' && obj.constructor.name === 'Observable');

Apparently it's not entirely correct

From @TylorS

This actually breaks the stuff that I'm working on because of the changes to isObservable. The stream library I'm using is most.js and it's constructor.name is Stream and not Observable. However it does implement Observable interfaces.

From @andywer

So how about that: We check with the current custom logic and fallback to is-observable or vice versa. If one of both is true we can be almost certain it is an Observable.

PS: I can also open an issue on zen-observable to use the symbol-observable so is-observable will work with the zen-observable as well.

// @jamestalmage @sindresorhus @jfmengels

@SamVerschueren
Copy link
Owner Author

@andywer The problem with is-observable is not that it doesn't work with zen-observable, it just gives us false-negatives and this has something to do with the import order. We can't change the import order because the Observable is provided by the dev that uses listr.

@andywer
Copy link
Contributor

andywer commented Sep 29, 2016

@SamVerschueren Right, I forgot about the import order issue (sindresorhus/is-observable#1 (comment))

Drats... 🙈

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

No branches or pull requests

2 participants