MCPcopy Index your code
hub / github.com/plotly/dash / gen_callback

Function gen_callback

tests/background_callback/app_diff_outputs.py:20–28  ·  view source on GitHub ↗
(index)

Source from the content-addressed store, hash-verified

18
19
20def gen_callback(index):
21 @app.callback(
22 Output(f"output-{index}", "children"),
23 Input(f"button-{index}", "n_clicks"),
24 background=True,
25 prevent_initial_call=True,
26 )
27 def callback_name(_):
28 return f"Clicked on {index}"
29
30
31for i in range(1, 3):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…