sindresorhus / any-observable

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

Allow for different export patterns. #7

Closed jamestalmage closed 8 years ago

jamestalmage commented 8 years ago

The string only option does not fit RxJs.

You can't do:

require('rxjs/Observable');

You need to do:

require('rxjs/Observable').Observable;

I think our default lookup strategy should be something like this:

function load(name) {
  var loaded = require(name);
  return loaded.Observable || loaded.default || loaded;
}
sindresorhus commented 8 years ago

We already manually handle that for RxJS, but yeah, might be useful for other future libs.

jamestalmage commented 8 years ago

No, we only do that in the detect() function. That won't work if they call register('rxjs')