aymeric-giraudet / svelte-algolia-instantsearch

A Svelte component library for Algolia InstantSearch.js
https://svelte-algolia-instantsearch.vercel.app/
MIT License
45 stars 12 forks source link

InstantSearch onStateChange #23

Closed mathg closed 10 months ago

mathg commented 11 months ago

Hello! Is there a way to implement onStateChange custom callback at the moment? When looking at the component it looks like this prop isn't exposed but maybe it binds differently with svelte underneath?

When looking here (https://www.algolia.com/doc/api-reference/widgets/instantsearch/js/) it seems that it's an option that is available on instantsearch.js

Thanks!

aymeric-giraudet commented 11 months ago

Hey @mathg !

InstantSearch was the first component I implemented when this was just a PoC and it's probably the only one left to be properly implemented. I'll look into it at the end of this week, shouldn't take too long I think !

Thinking out loud here, but if I also embrace slots a bit more like what's in vue-instantsearch and provide some kind of DynamicWidgets implem (with the limitations of Svelte it won't be as great as in React and Vue though), we'll definitely have enough for a 1.0.0 release.

mathg commented 10 months ago

Hi @aymeric-giraudet, do you have an ETA for this? Are you alone at Algolia working on this implementation? In a project I'm working on, I need to trigger scroll event when filtering changes and I was thinking on using this event to trigger it.

I'm guessing I could also use something like the CurrentRefinements components and use the connectCurrentRefinements to check when something changes.

aymeric-giraudet commented 10 months ago

Hi @mathg sorry I was traveling this whole month so I didn't have much time !

I might not have made it obvious enough, but this is a pet project separate from my work at Algolia, which I had started before even being hired, which means I'm working on it on my free time 😅

I should find some time while I'm settling again, but if you're willing to lend a hand you're welcome and so is everyone !

aymeric-giraudet commented 10 months ago

Hey @mathg just added this in commit 87caa6b

It's part of the 0.11.0 release !