fix(EventEmitter): resolve onError and onComplete asynchronously#4825
fix(EventEmitter): resolve onError and onComplete asynchronously#4825NathanWalker wants to merge 1 commit into
Conversation
9cba06d to
6c87180
Compare
|
@NathanWalker watch for #4893 as it will definitely impact this. the (annoyingly ugly) change will be that EventEmitter.subscribe() takes either |
|
@robwormald thanks for heads up 👍 |
6c87180 to
59286f3
Compare
|
while you're at it, i just found a nasty little hiccup, maybe have a look as you're in the guts of this right now: //create a subject
var s = new Subject();
//subscribe to it via the ObservableWrapper, passing only a next fn
ObservableWrapper.subscribe(s, (val) => {});
//call next
s.next(1);
//call complete (throws!)
s.complete(); |
0320930 to
1170337
Compare
|
This should solve your issue above as well @robwormald. Have a look and let me know. /cc @vsavkin |
|
As far as I can tell, |
|
specs are here https://github.com/angular/angular/blob/master/modules/angular2/test/core/facade/async_spec.ts I have one locally that looks like that throws - this replicates what I mentioned above. it('should subscribe to Subjects', () => {
let subject = new Subject();
ObservableWrapper.subscribe(subject, (val) => {});
subject.next(1);
subject.complete();
}) |
|
Ah ok. Lemme try that on my branch here. |
|
I have a fix coming (verified in isolation). Running locally all build/tests and will push the squashed commit shortly. |
1170337 to
f57cfc6
Compare
|
I used the same approach the RxJS team did here: Also the unit test now includes yours with an expansion to verify different signatures would still work. I'm just now seeing your comment... lemme see... |
|
otherwise tho, LGTM |
f57cfc6 to
e74d975
Compare
|
Good point. I updated the unit tests so it didn't look confusing. Not sure if there's anything we should do to prevent |
|
Hmm, dart not loving that (the TS specs get xpiled to dart and executed as well) - might try calling using the wrapper there: ObservableWrapper.callNext(e, 1);etc |
|
Thanks I'll try that shortly. On Fri, Oct 30, 2015 at 12:17 PM Rob Wormald notifications@github.com
|
|
@NathanWalker can you add "closes #4443" in your commit message? Also, could you shorten the title to "fix(EventEmitter): resolve onError and onComplete asynchronously" This should also be noted as a breaking change, so a |
|
Meh, nm about breaking change. |
e74d975 to
df34840
Compare
|
Thanks @jeffbcross @robwormald that should clear things up 👍 |
df34840 to
0a2301b
Compare
fcb7eb3 to
877858c
Compare
|
I added unit tests for async onError and onComplete and have everything passing now. |
|
@NathanWalker awesome. once #5302 lands, rebase and we should be good to go. |
877858c to
ae79fb1
Compare
|
5302 came, it saw, and landed; then this just dropped the rebass! take it away @robwormald |
ae79fb1 to
7a0068a
Compare
7a0068a to
ae5e8ec
Compare
|
LGTM. failing test is dartdoc known issue. |
|
Merged via 019cb41 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
#4443