I'm in wix and I'm trying to pass a function as a call back to a function that came from a backend and call it in my b
import {testCB} from "backend_filename.jsw"
testCB(d=>{
console.log("inside testCB");
console.log(d);
},123);
function in backend
export function testCB(cb, arg){
console.log("inside testCB:");
console.log(cb); console.log(arg);
cb(1,arg);
}
The output of the log shows that cb is null but the arg parameter's value passes through as 123. How do I pass a function as an argument through a function I imported from the backend?