Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大佬 quickjs 有啥异步交互的api能用吗 promise await 都不支持?有其他能用的异步方案吗 #23

Open
miaotaoii opened this issue Dec 12, 2022 · 1 comment

Comments

@miaotaoii
Copy link

No description provided.

@wu928320442
Copy link

可以这样

举例:

var requestParams = { "p1": "11" };
native.request("getHomeList", requestParams, function (e) {
    native.log("response:" + JSON.stringify(e));
});

当参数为方法时,参数为JSFunction,然后持有这个引用call调用就好了

((JSFunction) args.get(2)).call(receiver, new JSArray(jsContext).push(111111));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants