ekibun / flutter_qjs

A quickjs engine for flutter.
https://pub.dev/packages/flutter_qjs
MIT License
146 stars 28 forks source link

可以同步返回结果? #30

Closed CurrentIndex closed 2 years ago

CurrentIndex commented 2 years ago
var qjs = FlutterQjs();

var setToGlobal = qjs.evaluate("() => { retutn "Js result .. " }");
setToGlobal as JSInvokable;

var result1 = setToGlobal.invoke([]); // Future
var result2 = await setToGlobal.invoke([]); // Js result .. 
// 可以实现在调用 `JSInvokable.invoke` 时同步返回结果?像下面这样.
var result3 = setToGlobal.invoke([]); // Js result ..