You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide an api to check validity of query keys and provide defaults if invalid.
For whatever reason some users try to modify our search params manually. We assume this mostly happens when a url not fully copied to the clipboard. Nonetheless you'll end up with a query that looks like ?sort=highes for example; where the "t" is cutoff.
At the moment we are the default parameter but that only adds a default value if the key is not present instead of checking if the value is valid it seems.
We are currently checking this in our onMount like so; but it gets verbose when there are 15 keys to check for (search heavy data app).
Describe the problem
For whatever reason some users try to modify our search params manually. We assume this mostly happens when a url not fully copied to the clipboard. Nonetheless you'll end up with a query that looks like
?sort=highes
for example; where the "t" is cutoff.At the moment we are the
default
parameter but that only adds a default value if the key is not present instead of checking if the value is valid it seems.We are currently checking this in our
onMount
like so; but it gets verbose when there are 15 keys to check for (search heavy data app).Describe the proposed solution
An api similar to the
default
feature that would not only check for a missing key, but check for its validity and set a default value if invalid.The text was updated successfully, but these errors were encountered: