Open glennjacobs opened 5 days ago
Hi glenn! Hope you are enjoying swiftsearch! I'll take a quick look at the pr, thanks!
As a side note: why does each category require its own instant search instance? This can be quite heavy on user's memory. How many category pages do you have in your website?
As a side note: why does each category require its own instant search instance? This can be quite heavy on user's memory. How many category pages do you have in your website?
It's because we're using keep-alive so the user can hit the back button a few times. Therefore it is limited.
We’re building an online store with Nuxt and using this package for our category pages. Each category requires its own distinct instance of Algolia search.
To achieve this, we’ve utilised the
:instance-key
prop on the<ais-instant-search>
component, which ensures each page gets its own separate instance.However, the filter components, such as those created using useAisRefinementList, have a static key hardcoded currently (see this line). This causes the filters to behave incorrectly when switching between pages in our app.
I’ve tested a workaround by incorporating the instance ID into the state key, and it resolves the issue.
I plan to work on a PR to address this properly but would appreciate any feedback you have, especially if you have a preferred approach for implementing this fix.