Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/runtime/composables/useAlgoliaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export function useAlgoliaSearch (indexName?: string) {
return searchResult
}

onUnmounted(() => {
result.value = undefined;
});
Comment on lines +42 to +44
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, what about instead to provide a reset function so that the user can trigger this reset function when he needs? :)

It can even be the same (on onUnmounted hook) but it will be done by the consumer of the library instead of the library itself :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that makes more sense! :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, could you refactor your code to this change? Then I could merge, test and release a new version with it to unblock you :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Baroshem Can you continue here maybe? I dont have the time unfortunately


return {
result: computed(() => result.value),
search
Expand Down