Ist there any possibility to listen for an event when the search result is ready or loading?
The only event that I found ist "page-change" when using the pagination.
Hey @grund3g, what would you use this for? What would be your ideal use case?
Hi,
e.g. when using masonry layouts where I have to update / recalculate the layout when the search result is ready.
Maybe you can ask the user who has already done this here: https://discourse.algolia.com/t/algolia-instantsearch-vue-with-masonry-js/2215/2
Thanks for the link! I ended up doing the following:
<ais-index :app-id="xxx" :api-key="xxx" index-name="xxx">
<ais-event-wrapper>
// Other Components
</ais-event-wrapper>
</ais-index>
// AisEventWrapper.vue
<template>
<div>
<slot>
</slot>
</div>
</template>
<script>
import { Component } from 'vue-instantsearch';
export default {
mixins: [Component],
watch: {
'searchStore._results'(val) {
// Emit event
}
}
}
</script>
That seems like a good solution! I'll close this, but feel free to reopen or open another issue for other things 😄
@grund3g Have you upgraded to v2? I've found that this solution no longer works as well with v2, hoping that maybe you have found another solution.
@intrepidws, could you open a new issue, is this also for masonry?
Most helpful comment
Thanks for the link! I ended up doing the following:
// AisEventWrapper.vue