Skip to content

Instantly share code, notes, and snippets.

@ranwahle
Last active June 16, 2019 06:51
Show Gist options
  • Save ranwahle/11f02963e2e6f57bc26f2d4ebd4d32c6 to your computer and use it in GitHub Desktop.
Save ranwahle/11f02963e2e6f57bc26f2d4ebd4d32c6 to your computer and use it in GitHub Desktop.
Can Go On, with both guards
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