-
It would be nice to be able to access the instant search current state (or states, depending on how many instantsearch parent components we have in the page) in our component's setup via some composables like useInstantSearch, useAisStats, useCurrentRefinements etc. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
We have so far chosen to not yet support composables, but you can take the logic which is in widgetMixin and put that in a composable instead in your own codebase. You can be inspired by this PR: algolia/vue-instantsearch#1052 |
Beta Was this translation helpful? Give feedback.
-
For anyone stumbling across this discussion, I've started working at a nuxt 3 implementation for instantsearch https://nuxt-swiftsearch.netlify.app/ |
Beta Was this translation helpful? Give feedback.
-
Chiming in here, as the enterprise company I work for relies heavily on Algolia and uses the Our application has gone through a lot of work to embrace Vue 3's Composition API and the I've been able to import types from the core library and derive a custom composable to recreate what I really appreciate several cases in the past, particularly around 2020 and 2021, where Algolia staff and @Haroenv in particular helped troubleshoot and published updates for specific SSR issues we faced -- especially to help us use two different types of pages driven by the system that, at first, could not navigate between the types directly. This answer to avoid supporting the pattern entirely made sense in early 2023, when both versions were actively maintained. As it stands now, though, I believe the best course of action would be to sunset Vue 2 support2 and offer a solution that fits with the framework's evolution and prioritizes TS support, as other major libraries have done. Footnotes
|
Beta Was this translation helpful? Give feedback.
We have so far chosen to not yet support composables, but you can take the logic which is in widgetMixin and put that in a composable instead in your own codebase. You can be inspired by this PR: algolia/vue-instantsearch#1052