chore(zones): update zones/proxies to use connectedSubscription #2128
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.
Simplifies the 'knitting' of Zones and their Proxies by using connectedSubscription.
I think this is the last place where we had a subscription inspection without using our new
Subscription
data layer things. See #1890Separately, I spent a lot of time trying to get typescript to understand
Object.groupBy
and/or a type safe polyfill for it, which would simplify this even more and use even less of our own code, but I kinda gave up trying. I can come back to that at a later date. edit: I didn't PR this branch straight away for reasons, and luckily I found out todayObject.groupBy
is coming to typescript in the next release in around a month or so, so I'll wait for that. I still have a branch or stash here with the nativeObject.groupBy
usage, so I can PR that once the support comes with typescript.Also, its important for me to make sure I note in relation to #1918 (comment) that I've removed an instance of
isSet
usage whilst I was here. For the following reason: Unless I've missed something,withConfig
here can never benull
(its the result ofArray.find
which never returnsnull
) so I don't see any point usingisSet
where we can just use straight/native JS instead i.e. this is the better refactor/fix.There are other places where I think we no longer need
isSet
, but seeing as I was changing code here anyway, I only updated things here for the moment.