-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better observable dependency handling and fix baqend distribution
- Loading branch information
1 parent
fcde813
commit c35c256
Showing
8 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
require('../polyfills'); | ||
|
||
module.exports = require('./baqend'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* loads the observalbe from the global context, the global Rx variable or try to load Rx.js, fallback to core-js shim | ||
* The Observable can be overwritten by setting the require('baqend/streaming').Observable = Observable afterwards | ||
*/ | ||
|
||
if (typeof Observable != 'undefined') { | ||
module.exports = Observable; | ||
} else if (typeof Rx !== 'undefined') { | ||
module.exports = Rx.Observable; | ||
} else { | ||
try { | ||
module.exports = require('rxjs/Observable').Observable; | ||
} catch (e) { | ||
require('core-js/modules/es7.symbol.observable'); | ||
require('core-js/modules/es7.observable'); | ||
var sub = Observable.prototype.subscribe; | ||
|
||
//patch subscribe until core-js implements the new proposal | ||
//https://github.com/zloirock/core-js/issues/257 | ||
Observable.prototype.subscribe = function(onNext, onError, onComplete) { | ||
if (onNext instanceof Function) { | ||
return sub.call(this, { | ||
next: onNext, | ||
error: onError, | ||
complete: onComplete | ||
}); | ||
} else { | ||
return sub.call(this, onNext); | ||
} | ||
}; | ||
|
||
module.exports = Observable; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters