-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Subscriber refactor, operator updates, and scheduling fixes. #1106
Conversation
It confuses Sublime's TypeScript plugin.
Cleans up Observable properties, and only creates a new Subscriber if the Observable has an operator.
Remove shared Subscription list. Make Subscribers automatically unsubscribe upon error or completion. Add SafeSubscriber to safely wrap callback arguments to Observable's subscribe.
…on management. Updates Subject, AsyncSubject, BehaviorSubject, and ReplaySubject to mimic the behavior of Subscriber. Removes the private BidirectionalSubject in favor of implementing the chaining logic in the Subject's methods (this allows us to extend and chain Subjects with `lift` in the same manner as we can with Observable). Fixes ReplaySubject to route messages through its scheduler (if specified), which mimics current RxJS v4 behavior. Refactors Subject's Symbol.rxSubscriber implementation to return the Subject wrapped inside a Subscriber. This ensures the Subject won't be disposed if its Subscription is.
Use isPromise utility function to check if an instance is a Promise. Import and use `root.setTimeout` instead of using global `setTimeout` definition.
…for new Subscriber impl.
Updates most operators to correctly extend the new Subscriber implementation. Refactors some operators that track inner Subscriptions to extend OuterSubscriber. Updates the test-helper to ensure all tests are run asynchronously, as Jasmine has trouble with the boundaries between synchronous and asynchronous tests.
Fix AsapAction to store its scheduled ID on the scheduler instead of on itself. This ensures that if the first AsapAction is canceled, other AsapActions will still execute. Ensure both QueueAction and AsapAction extend FutureAction, so if either action is rescheduled with a delay > 0, they'll successfully reschedule with the proper timeout.
FWIW: I've already reviewed most of this over the last few days. I'll give it a final review over the next few days. It's Christmas, so it's probably going to be more later than sooner. |
We'll need to update the CHANGELOG manually with what's been fixed, because the changes required to fix those issues were broad, required multiple commits, and weren't necessarily linked directly to those issues |
OK, will keep eye |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
attention: @Blesh @staltz @kwonoj
Subscription
list fromSubscribers
and updates theObservable
,Subject
, andOperator
implementations accordingly.Subscriptions
but weren't extendingOuterSubscriber
or using oursubscribeToResult
util. The more operators that use this pattern, the more operators that will interop with Array/Iterable/Promise/Observable-esque instances.setTimeout
instead of rescheduling like they normally would.Observables
and operators that default to thequeue
scheduler. Nothing should ever default to thequeue
scheduler, becauseasap
scheduler for timing operators (likedelay
).null
instead ofvoid 0
expressionsroot.setTimeout
instead ofsetTimeout
)