gridsome-plugin-flexsearch icon indicating copy to clipboard operation
gridsome-plugin-flexsearch copied to clipboard

Support callback function or regex in autoFetch

Open louis-l opened this issue 3 years ago • 2 comments

Hi,

Thanks for the awesome plugin. I have a use case where the search component is shared in multiple pages (e.g. /docs/my-help-article-1...) I checked https://github.com/thetre97/gridsome-plugin-flexsearch/blob/main/gridsome.client.js#L67 and it seems like the autoFetch is being "hard checked". So my suggestion is to support a callback function or regex or prefix (e.g. "/docs/*").

Cheers,

louis-l avatar Oct 17 '21 11:10 louis-l

Hey @louis-l - good suggestion. Feel free to create a PR, or I will work on this when I get a chance.

travis-r6s avatar Oct 19 '21 18:10 travis-r6s

@thetre97

Here you go: https://github.com/thetre97/gridsome-plugin-flexsearch/pull/76

louis-l avatar Oct 19 '21 21:10 louis-l