Comments (2)
Plugin wraps the parameters and returns automatically. Both your demo returns Future
in the function, and you would get Promise
in Javascript side. you can get result with await IN JAVASCRIPT:
(async (url) => {
var rsp = await http(url);
/** or **/
http(url).then((rsp) => {
/** your code here **/
})
})()
If you want to get the return value directly. you SHOULD NOT use async syntax or return Future in the function:
await setToGlobalObject.invoke(["http", (String url) {
return "directly";
}]);
from flutter_qjs.
thanks.
i want my js code run after dart future task done.
it should be related with dart microtask .
from flutter_qjs.
Related Issues (20)
- 将dart方法注入到js引擎后, 通过js对象调用该方法总是返回Future<dynamic> HOT 2
- [BUG] JSTag value mismatching because of int32 value conversion HOT 5
- iOS 模拟器运行报错
- SetInterruptHandler and SetMemoryLimit missing HOT 1
- support call function name HOT 1
- Standard Library? HOT 4
- ES6 import相关 HOT 5
- Upgrade to ffi 2.0.1 - Dart 2.17
- 可以同步返回结果?
- Give more control over `jsExecutePendingJob` / `_executePendingJob` HOT 1
- BigInt support HOT 3
- Dart CLI without Flutter ? HOT 2
- Reference leak when doing `Object.freeze` HOT 1
- Please, update Kotlin version
- How can I do? HOT 1
- how to do http request in flutter_qjs HOT 1
- Can debugging functionality be supported?
- does moduleHandler has baseModuleName for relative path?
- InternalError: stack overflow HOT 1
- Linux test produces `Failed to load dynamic library 'test/build/libffiquickjs.so'` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter_qjs.