Hi,
I am currently trying to put my clientside callbacks out of my app.py-file into .js-files and am receiving an error.
As long as I have only one function and one .js-file everything works fine. However I want to have more than one function to call by clientside callbacks.
I tried to have two .js-files and two clientside callbacks and received an error:
TypeError: dc[namespace][function_name] is undefined
_callee2$ callbacks.ts:151
tryCatch callbacks.ts:2
_invoke callbacks.ts:2
defineIteratorMethods callbacks.ts:2
asyncGeneratorStep callbacks.ts:2
_next callbacks.ts:2
_asyncToGenerator callbacks.ts:2
File 1 āfunction1.jsā:
window.dash_clientside = Object.assign({}, window.dash_clientside, {
clientside: {
function1: function() {
alert("first function");
}
}
});
Callback 1:
app.clientside_callback(
ClientsideFunction(
namespace='clientside',
function_name='function1'
),
Output('dump-1', 'children'),
Input('interval-1', 'n_intervals')
)
File 2 āfunction2.jsā:
window.dash_clientside = Object.assign({}, window.dash_clientside, {
clientside: {
function2: function() {
alert("second function");
}
}
});
Callback 2:
app.clientside_callback(
ClientsideFunction(
namespace='clientside',
function_name='function2'
),
Output('dump-2', 'children'),
Input('interval-2', 'n_intervals')
)
Can someone tell me how to define multiple functions for clientside callbacks in .js-files?