Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linkSelector option #64

Open
woldtwerk opened this issue Aug 24, 2022 · 1 comment
Open

Add linkSelector option #64

woldtwerk opened this issue Aug 24, 2022 · 1 comment

Comments

@woldtwerk
Copy link

woldtwerk commented Aug 24, 2022

Setting [data-cold] might not always be possible. It would be nice to have the option to opt-(out/in) using a selector.

Something like that:

const linkSelector = ':not(.some-class)'

if (!anchor.matches(linkSelector)) {
  return { type: 'disqualified' };
}

Any thoughts?

@prowebat
Copy link
Contributor

maybe a more generic solution would be to allow a callback in the flamethrower config

const router = flamethrower({ 
  isLinkQualified: (anchor) => true; /* can return true or false */
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants