Open
Description
Is the code below or equivalent possible ?
What is the best way to achieve this functionality ?
class_<std::function<void()>>("_callback")
.constructor<>()
.function("opcall", &std::function<void()>::operator())
;
emscripten::val window = emscripten::val::global("window");
std::function<void()> wrapped = []() {
std::cout << "Hello " << "\n";
};
emscripten::val intervalId = window.call<emscripten::val>("setInterval", wrapped, 1000);
The code below does not work on the js side. It is called periodically but produce an error on each call
Uncaught SyntaxError: missing ] after element list14 [lython.js line 3599 > Function:6:9](http://192.168.2.20:8000/build/Release/bin/lython.js%20line%203599%20%3E%20Function)note: [ opened at line 6, column 1