zen-observable
Advanced tools
Comparing version 0.9.0 to 0.10.0
@@ -13,6 +13,2 @@ "use strict"; | ||
if (!hasSymbol('observable') && Object.isExtensible(Symbol)) { | ||
Symbol.observable = Symbol('observable'); | ||
} | ||
const SymbolIterator = getSymbol('iterator'); | ||
@@ -19,0 +15,0 @@ const SymbolObservable = getSymbol('observable'); |
{ | ||
"name": "zen-observable", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"repository": "zenparsing/zen-observable", | ||
@@ -5,0 +5,0 @@ "description": "An Implementation of ES Observables", |
@@ -6,6 +6,2 @@ // === Symbol Support === | ||
if (!hasSymbol('observable') && Object.isExtensible(Symbol)) { | ||
Symbol.observable = Symbol('observable'); | ||
} | ||
const SymbolIterator = getSymbol('iterator'); | ||
@@ -12,0 +8,0 @@ const SymbolObservable = getSymbol('observable'); |
@@ -44,3 +44,3 @@ import assert from 'assert'; | ||
'constructor': Observable, | ||
[Symbol.observable]() { return this }, | ||
[observableSymbol]() { return this }, | ||
}; | ||
@@ -50,5 +50,13 @@ assert.ok(Observable.from(obj) !== obj); | ||
it('uses @@observable as the property name unless polyfilled', () => { | ||
let obj = { | ||
'constructor': Observable, | ||
'@@observable'() { return this }, | ||
}; | ||
assert.ok(Observable.from(obj) !== obj); | ||
}); | ||
it('throws if @@observable property is not a method', () => { | ||
assert.throws(() => Observable.from({ | ||
[Symbol.observable]: 1 | ||
[observableSymbol]: 1 | ||
})); | ||
@@ -67,3 +75,3 @@ }); | ||
let observable = Observable.from({ | ||
[Symbol.observable]() { return inner }, | ||
[observableSymbol]() { return inner }, | ||
}); | ||
@@ -70,0 +78,0 @@ observable.subscribe(); |
@@ -7,4 +7,5 @@ import { Observable } from '../src/Observable.js'; | ||
let $extensions = Object.getOwnPropertySymbols(Observable)[1]; | ||
let { hostReportError } = Observable[$extensions]; | ||
let { hostReportError, symbol } = Observable[$extensions]; | ||
hostReportError.log = (e => global.hostError = e); | ||
global.observableSymbol = symbol; | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67502
2085