Listen for changes to variable value in datasource

I have a datasource that populates a set of fields based upon a variable’s value. If the value of said variable changes, those populated fields should either be cleared out or re-populated. I’ve been searching the docs and other community posts and have been unable to find a clean way of doing this - is this possible?

Add support for variables in plugins | Grafana documentation - These are the docs that document how to add support for variables, but only cover how to listen for changes to query variables.

How to listen for when a variable changes? - This covers how it might be done for a plugin, but not a datasource.