Detect when the parent app is not listening for a module input query

While relatively new to retool, I've started making copious use of modules which has been fantastic (especially as a dev with a React background).

One issue I'm having is that in some modules (say a select component) in specific instances I want to detect that something has changed and run a js function in the parent component, which module input queries are perfect for.

However in other use cases for the same component, I can bind to an output variable, but don't need to listen for an actual change.

But in these instances I get this error message:


So I'm wondering, is there any way from within the module to detect that nothing is listening for this module input query and not trigger it.

(As it stands to suppress this error I need to bind the module to a dummy query that does nothing)

Hope that makes sense.


Update: I've come up with a solution for this.

Simply create a module input called something simple like listenForOnChange.

Before calling the module input query, check that this has been set to true.

And then only set it to true in the parent applications where you need to listen for that event.