Repository navigation
feat(router): add prioritizedGuardValue operator optimization and allowing UrlTree return from guard - #26478
feat(router): add prioritizedGuardValue operator optimization and allowing UrlTree return from guard#26478jasonaden wants to merge 2 commits into
Conversation
…owing UrlTree return from guard * If all guards return `true`, operator returns `true` * `false` and `UrlTree` are now both valid returns from a guard * Both these values wait for higher priority guards to resolve * Highest priority `false` or `UrlTree` value will be returned
|
You can preview 5583eb3 at https://pr26478-5583eb3.ngbuilds.io/. |
…and allowing UrlTree return from guard
|
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
|
A Googler has manually verified that the CLAs look good. (Googler, please make sure the reason for overriding the CLA status is clearly documented in these comments.) |
benlesh
left a comment
There was a problem hiding this comment.
LGTM. Just a few small nits.
| OperatorFunction<Observable<boolean|UrlTree>[], boolean|UrlTree> { | ||
| return switchMap(obs => { | ||
| return combineLatest( | ||
| ...obs.map(o => o.pipe(take(1), startWith(INITIAL_VALUE as INTERIM_VALUES)))) |
There was a problem hiding this comment.
Nit: o => o.pipe(take(1), startWith(INITIAL_VALUE as INTERIM_VALUES))) could be pulled out into it's own static function for better performance and lower memory pressure. (Also might help readability)
| scan( | ||
| (acc: INTERIM_VALUES, list: INTERIM_VALUES[]) => { | ||
| let isPending = false; | ||
| return list.reduce((innerAcc, val, i: number) => { |
There was a problem hiding this comment.
Nit: The reducer function inside of here could be pulled out into it's own static function (like above)
| }, acc); | ||
| }, | ||
| INITIAL_VALUE), | ||
| filter(item => item !== INITIAL_VALUE), take(1)) as Observable<boolean|UrlTree>; |
There was a problem hiding this comment.
Nit: Adding a trailing comma will make clang format this cleaner.
…owing UrlTree return from guard (#26478) * If all guards return `true`, operator returns `true` * `false` and `UrlTree` are now both valid returns from a guard * Both these values wait for higher priority guards to resolve * Highest priority `false` or `UrlTree` value will be returned PR Close #26478
… and allowing UrlTree return from guard (angular#26478)" This was incorrectly merged to the 7.0.x patch version branch. This reverts commit d5fa4dc.
|
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. |
true, operator returnstruefalseandUrlTreeare now both valid returns from a guardfalseorUrlTreevalue will be returned