Configuration for "giving up" #287
craigmichaelmartin
started this conversation in
Ideas
Replies: 2 comments
-
The question here seems to be You're simply asking the author to add this functionality to the core library. Or are you asking for help how to accomplish this in your own code at the same time? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the quick response! I tagged it the discussion with "Idea" - I'm wondering if maintainers would accept a PR to add something like this, and if so, what the right shape of it might be. |
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
-
To save on server load, what are your thoughts on a configuration to short-circuit the data.src function?
A "give up" function could accept the previous query, current results (from that previous query), and the new query. If the function returns true, the data.src function is short-circuited and returns [].
For example, if "Tay" doesn't produce any results, I don't want the data.src function hitting the server with:
Tayl
Taylo
Taylor
Taylor
Taylor S
Taylor Sw
Taylor Swi
Taylor Swif
Taylor Swift
Maybe
dataBypass
is a more generic name (especially if previous results passed in) and not just only called when there are no previous results (my original). In this more general approach, the return value could be the new array (empty if giving up). Perhaps when there are only a few results returned from the last query, and this query is a superset of it (whatever that means for them), developers might want to use this dataBypass to do the filtering client-side.Beta Was this translation helpful? Give feedback.
All reactions