Skip to content

Commit

Permalink
Merge pull request #200 from blesh/use-symbol-observable
Browse files Browse the repository at this point in the history
fix(Symbol.observable): Ensure compatability with other polyfills
  • Loading branch information
rpominov committed Apr 26, 2016
2 parents 4a7f06c + a8d285a commit db5c0db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"transducers-js": "0.4.174",
"transducers.js": "0.3.2",
"zen-observable": "0.1.3"
},
"dependencies": {
"symbol-observable": "^0.2.4"
}
}
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ import fromESObservable from './interop/from-es-observable';
// (Stream|Property) -> ES7 Observable
import toESObservable from './interop/to-es-observable';
Observable.prototype.toESObservable = toESObservable;
import symbol from './utils/symbol'
Observable.prototype[symbol('observable')] = toESObservable;
import $$observable from 'symbol-observable';
Observable.prototype[$$observable] = toESObservable;



Expand Down
5 changes: 2 additions & 3 deletions src/interop/from-es-observable.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import stream from '../primary/stream';
import symbol_ from '../utils/symbol';
const symbol = symbol_('observable');
import $$observable from 'symbol-observable';

export default function fromESObservable(_observable) {
const observable = _observable[symbol] ? _observable[symbol]() : _observable;
const observable = _observable[$$observable] ? _observable[$$observable]() : _observable;
return stream(function(emitter) {
const unsub = observable.subscribe({
error(error) {
Expand Down
9 changes: 0 additions & 9 deletions src/utils/symbol.js

This file was deleted.

0 comments on commit db5c0db

Please sign in to comment.