Last active
June 16, 2019 06:51
-
-
Save ranwahle/11f02963e2e6f57bc26f2d4ebd4d32c6 to your computer and use it in GitHub Desktop.
Can Go On, with both guards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async canGoOn(routeData, guard, oldGuard, prevUrl) { | |
let result = true; | |
if (oldGuard) { | |
result = await oldGuard(prevUrl); | |
} | |
if (guard && result) { | |
result = await guard(routeData) | |
} | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment