Skip to content

I need to update <Configure /> analyticsTags value without causing refetch #5982

Closed Answered by Haroenv
Ali-hd asked this question in Q&A
Discussion options

You must be logged in to vote

If you want to update parameters outside of the InstantSearch life cycle, I suggest that you actually keep track of them outside and apply it to the final "search" request outside like this:

const searchClient = algoliasearch('','');
const searchFn = searchClient.search;
searchClient.search = function search(queries) {
  return searchFn(queries.map(({ params, ...rest,  }) => ({ ...rest, params: { ...params, analyticsTags: [...] }}))
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by Ali-hd
Comment options

You must be logged in to vote
1 reply
@Haroenv
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants