sindresorhus / any-observable

Support any Observable library and polyfill
MIT License
70 stars 12 forks source link

shamelessly steal entire implementation from any-promise #9

Closed jamestalmage closed 8 years ago

jamestalmage commented 8 years ago

any-promise is just very well thought out, there's no point to reinventing the wheel here.

Adds all the following features:

sindresorhus commented 8 years ago

Good idea! I naively thought I could do it simpler than any-promise initially.

sindresorhus commented 8 years ago

Automatically handles es6 style exports (named or default)

This is not part of any-promise, right? If true, we should document it.

jamestalmage commented 8 years ago

Allows you to register the constructor explicitly.

That's already part of any-promise. See the advanced section

Automatically handles es6 style exports (named or default)

any-promise only does the following:

var Promise = lib.Promise || lib;

we do:

var Observable = lib.Observable || lib.default || lib;

I haven't seen any implementations where that's actually useful yet, just seemed to be sensible - if they export a default - use that.

sindresorhus commented 8 years ago

Ok, cool.