Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #197
Fixes: #196
Fixes: #186
Fixes: #184
Fixes: #176
Fixes: #165
Fixes: #91
This doesn't yet include updated tests, but I did update the spec.
I purposefully tried to leave out spec changes/fixes that might be controversial, like changing/removing the 3-arg
subscribe
variant or not swallowing errors. But here's a list of what I did fix (I think this is all):Observable.from
to correctly use @@iterator for the iterable case.next
/error
/complete
operations to just use variants of the same core algorithm. I also used it to replace the erroneous object method call withinObservable.prototype.subscribe
. This simplified the spec tremendously without loss of clarity.Observable.from
andObservable.of
to 1. type-check their input, and 2. work on their arguments generically instead of assuming they're subscription observers.unsubscribe
method check instead of accessing it twice. I still maintained the object check so engines can avoid handling nonsensical cases.I'm aware it reads a bit like shotgun surgery, but when I was trying to write an optimized implementation of this (with JIT-compiled pipelines), trying to figure out the behavior I needed to maintain required so many explicit spec deviations I decided my time was better spent fixing the spec so I could do the experiment. And yes, a lot of things needed fixed.