Closed Baroshem closed 1 year ago
I have managed to make it work in a even simpler approach.
useAlgoliaSearch
composable automatically finds out whether a request is made from SSR or client and based on that, an appriopriate requester is used.
So users can now use:
const { data } = await useAsyncData('test', () => search({ query: 'Samsung' }))
Is your feature request related to a problem? Please describe.
This topic have appeared some time ago but back then, I was not able to make it work. Today I managed to find a way to be able to send a request to Algolia from useAsyncData but it is not very elegant.
As a part of this issue, I would like to create a new configuration entry
nodeRequester
that when set to true, it will create a new global object in nuxt App calledalgoliaNode
so that later in useAlgoliaSearch composable users could do something like this:Describe the solution you'd like
Describe alternatives you've considered
Additional context