1
JS代码是:如何从N-API异步调用引用函数,我无法获得“env”!
const obj = tap.create();
quote.on("connection", (params) => {
console.log('[DEBUG js]', 'connection called, params:', params);
});
记忆功能在C++:
napi_create_reference(env, args[1], 1, &cbMap[eIt->second]);
当本地函数被调用:
void TAP_CDECL Spi::OnConnect(int errorCode, const Info *info) {
{{I want to call the function from cbMap here, How to write code? I do not
known how to find "env"!}}
}