Hi there,
Today’s tips are just a few words.
Only write the same logic once when using client-side callbacks, while regular callbacks must have a corresponding decorated function due to the use of decorators.
As in Chris’ reply, you can construct regular callbacks without decorators.
app.clientside_callback(
ClientsideFunction(namespace='clientside', function_name='the_same_func'),
Output(1, ''),
Input(1, ''))
app.clientside_callback(
ClientsideFunction(namespace='clientside', function_name='the_same_func'),
Output(2, ''),
Input(2, ''))
window.dash_clientside = Object.assign({}, window.dash_clientside, {
clientside: {
the_same_func: () => do_something()
}
});
Hope this helps you. XD