After load event on recommend-js? #138
-
|
Is there any kind of after load event when, for example, I've got a set up like this at the moment to initialise a third-party slider on the loaded products: fetch(
relatedProducts({
// config
});
).then(function() {
// init third-party slider
});On certain browsers sometimes this seems to run the third-party slider init code before the products/html from |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
There are currently 2 ways to achieve this:
This is a lightweight API client that gives you back the recommendations as an object. This is the most versatile way to hook into before/after events. However, with this approach you'll need to handle rendering on your own. I hope that helps ! |
Beta Was this translation helpful? Give feedback.
There are currently 2 ways to achieve this:
Using InstantSearch.js you can checkout this StackOverflow answer https://stackoverflow.com/questions/42672838/algolia-instantsearch-add-a-callback-after-results-are-displayed
Using the Recommend API client
This is a lightweight API client that gives you back the recommendations as an object. This is the most versatile way to hook into before/after events. However, with this approach you'll need to handle rendering on your own.
I hope that helps !