@cycle/core
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -63,8 +63,10 @@ "use strict"; | ||
var subscription = new Rx.CompositeDisposable(); | ||
for (var _name4 in observables) { | ||
if (observables.hasOwnProperty(_name4) && subjects.hasOwnProperty(_name4) && !subjects[_name4].isDisposed) { | ||
subscription.add(observables[_name4].doOnError(logToConsoleError).subscribe(subjects[_name4].asObserver())); | ||
setTimeout(function () { | ||
for (var _name4 in observables) { | ||
if (observables.hasOwnProperty(_name4) && subjects.hasOwnProperty(_name4) && !subjects[_name4].isDisposed) { | ||
subscription.add(observables[_name4].doOnError(logToConsoleError).subscribe(subjects[_name4].asObserver())); | ||
} | ||
} | ||
} | ||
observer.onNext(subscription); | ||
observer.onNext(subscription); | ||
}, 1); | ||
@@ -79,3 +81,3 @@ return function dispose() { | ||
}; | ||
}).delay(1); | ||
}); | ||
} | ||
@@ -82,0 +84,0 @@ |
{ | ||
"name": "@cycle/core", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": "Andre Staltz", | ||
@@ -5,0 +5,0 @@ "description": "A fully reactive JavaScript framework for Human-Computer Interaction", |
@@ -61,15 +61,17 @@ let Rx = require(`rx`) | ||
let subscription = new Rx.CompositeDisposable() | ||
for (let name in observables) { | ||
if (observables.hasOwnProperty(name) && | ||
subjects.hasOwnProperty(name) && | ||
!subjects[name].isDisposed) | ||
{ | ||
subscription.add( | ||
observables[name] | ||
.doOnError(logToConsoleError) | ||
.subscribe(subjects[name].asObserver()) | ||
) | ||
setTimeout(() => { | ||
for (let name in observables) { | ||
if (observables.hasOwnProperty(name) && | ||
subjects.hasOwnProperty(name) && | ||
!subjects[name].isDisposed) | ||
{ | ||
subscription.add( | ||
observables[name] | ||
.doOnError(logToConsoleError) | ||
.subscribe(subjects[name].asObserver()) | ||
) | ||
} | ||
} | ||
} | ||
observer.onNext(subscription) | ||
observer.onNext(subscription) | ||
}, 1) | ||
@@ -84,3 +86,3 @@ return function dispose() { | ||
} | ||
}).delay(1) | ||
}) | ||
} | ||
@@ -87,0 +89,0 @@ |
@@ -73,2 +73,23 @@ 'use strict'; | ||
it('should happen on event loop\'s next tick', function (done) { | ||
function app() { | ||
return { | ||
other: Cycle.Rx.Observable.from([10, 20, 30]), | ||
}; | ||
} | ||
let mutable = 'wrong'; | ||
function driver(req) { | ||
return req.map(x => 'a' + 10) | ||
} | ||
let [requests, responses] = Cycle.run(app, {other: driver}); | ||
responses.other.take(1).subscribe(x => { | ||
assert.strictEqual(x, 'a10'); | ||
assert.strictEqual(mutable, 'correct'); | ||
requests.dispose(); | ||
responses.dispose(); | ||
done(); | ||
}); | ||
mutable = 'correct'; | ||
}); | ||
it('should not work after has been disposed', function (done) { | ||
@@ -75,0 +96,0 @@ let number$ = Cycle.Rx.Observable.range(1, 3) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
624153
10912