react-use-flexsearch
react-use-flexsearch copied to clipboard
Fix rawResults.map is not a function
Detect when an object is returned from index.search() and populate the result from store accordingly.
Hi @Jixabon, thank you for the PR. This definitely looks worthwhile to add.
Do you mind adding a test for this functionality to make sure it works? Also want to make sure future changes do not break your PR.
Something like "returns results if query has matches when flexsearch results are an object" after this test? https://github.com/angeloashmore/react-use-flexsearch/blob/8444b386cbb0f9417eea76127a3b6e26a1cda9ab/src/index.test.js#L78-L96
Thank you again, and please let me know if you have questions about adding the test.