Check if all parameters are clear or not

Hey!

On a page where I use Instant Search JS, I’d like to be able to do things (like hiding and showing specific elements) depending on whether there’s any kind of parameters (search queries or refinements) applied or not.

Like this:

if all parameters are clean/empty
do this
else
do this

Since I use routing, I’ve accomplished this for now by looking for the URL change, but that’s a bad solution since the URL updates a second after the UI which leads to a bad user experience.

Can I do this with uiState somehow?
Any tips? :slight_smile:

(my js skills are very limited)