Run callback anytime a component's 'value' is changed - or anytime a component property is changed

Is there any way to do this?

Alternatively… any way to run a callback every time any component is updated?
I want to update the url of the app based on the inputs. But I don’t want to have to add every input manually… is there some property of the app that changes everytime a component is updated? Or some way to dynamically insert every component into the callback’s inputs? I’ve tried looping through layout.children, but the layout is generated via a function, and so that doesn’t seem to work for me…

I could use dcc.Interval and just fire it every second… ive considered that but its inelegant.

Hi @klappec

Is not clear your question to me :thinking:

Could you explain with an example?

I want a callback that runs everytime any property of any component is updated. Or any time the ‘value’ property of any component is updated. but I don’t want to manually add every component to a callback one at a time. I need something more generic. I literally don’t even need to get what component was changed, or what it changed to. It just needs to fire.

Sorry, I do not know a way to do that, just adding all your components as inputs in the callback. :woozy_face:

One easier way would be to use Pattern-Matching Callbacks. Using dash.dependencies.ALL would give you the ability to adress all components as Input in a single line.

However, you will have to set up every component’s ID accordingly, which will be some additional work and may make callbacks that only use a single or few components more complex.

1 Like