Skip to content

Instantly share code, notes, and snippets.

@adodado
Created January 15, 2021 15:58
Show Gist options
  • Save adodado/c51d5200c6dc146b5d1dcb36160e9e17 to your computer and use it in GitHub Desktop.
Save adodado/c51d5200c6dc146b5d1dcb36160e9e17 to your computer and use it in GitHub Desktop.
medium_microfrontend_article_activity-functions
export function prefix(location, ...prefixes) {
return prefixes.some(
prefix => location.href.indexOf(`${location.origin}/${prefix}`) !== -1
);
}
export function nav() {
return true;
}
export function app1(location) {
return prefix(location, "app1");
}
export function app2(location) {
return prefix(location, "app2");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment