-
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
Merge refactor #316
Merge refactor #316
Conversation
- moves support types from merge-support to mergeAll-support - fixes strange issues with async - adds virtual time tests for merge and mergeAll
…efore hot subjects
- adds virtual time tests for expand - refactors expand to be its own operator, reducing inheritence
- removes inheritance from merge - improves performance through fewer function calls - ensures scalar (same behavior as before, but readded)
- still inherits from flatMap, but flatMap has changed slightly
makes ability to schedule more apparent
- make ability to schedule more apparent - check for scheduler and insert concurrency of 1 at proper point for merge call
Oh, one additional thing...
|
…se subscriber instead
constructor(destination: Observer<T>, | ||
project: (value: T, index: number) => Observable<R>, | ||
resultSelector?: (innerValue: R, outerValue: T, innerIndex: number, outerIndex: number) => R2) { | ||
super(destination, project, resultSelector, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Blesh Does this work? It looks like this makes the SwitchLatestSubscriber
equivalent to concat
... right?
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. |
Due to problems outlined in #302, I ended up adding more virtual time tests and found quite some behaviors weren't working as expected. Since #222 is still open, and it's something I wanted to tackle, and since the high level of inheritance in operators like
switchAll
made debugging a little painful, I opted for a refactor.Unfortunately, refactoring merge touched a lot of other operators (
concat
,concatAll
,switchAll
,switchLatest
,switchLatestTo
,flatMap
,flatMapTo
,merge
,mergeAll
,Observable.merge
,Observable.concat
, andexpand
)The basics of the changes are as follows:
expand
has it's own standalone subscriberflatMap
has it's own standalone subscriberswitchAll
has it's own standalone subscribermergeAll
has it's own standalone subscriberswitchLatest
(which should beswitchMap
) inherits fromflatMap
subscriberflatMapTo
inherits fromflatMap
subscriberswitchLatestTo
inherits fromflatMapTo
subscriberother changes were just changes to calls to reflect better typing information.
Also, I had to fix a bug in the TestScheduler that was having
hot
observables subscribe and emit before the expectation observables did. This meant that if a subject (hot observable) emitted on frame 0, it wouldn't be provided to the expectation observable being tested because it hadn't subscribed yet.sincerest apologies for such a large PR
... at least I broke it into several commits.