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"!}}
}