Replies: 1 comment
-
let prevResults;
new autoComplete({
data: {
src: async (query) => {
// Check prevResults and only trigger an API request if necessary
},
},
resultsList: {
element: (element, data) => {
const { matches } = data
prevResults = matches
},
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to lighten the load on my API. Say the user types in "i" and the results "pizza", "sushi", and "fresh juice" appear. If they then add a "z", making their query "iz", I don't need to hit my API again to know that the only result should be "pizza".
If someone could just point me in the right direction. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions