Comments (3)
Hello @theolivenbaum,
Thanks a lot for the feed-back and the solution. I tried it and the problem is solved.
Sorry that I missed the point of the input arguments pass-through.
from h5.
Hi @YImhof,
The issue seems to be from the implementation of fromPromises:
promise.then(function () {
tcs.setResult(handler ? handler.apply(null, arguments) : Array.prototype.slice.call(arguments, 0));
}, function () {
tcs.setException(errorHandler ? errorHandler.apply(null, arguments) : new H5.PromiseException(Array.prototype.slice.call(arguments, 0)));
}, progressHandler);
As you can see, arguments is the calling arguments from the function on promise.then, and it is just passed as the result to the Task.
That's why the signature of Task.FromPromise is
public static extern Task<object[]> FromPromise(IPromise promise);
I think the right way for you to use the template should be instead to pass the argument number you want from the response in the "handler" argument:
[External]
[Name("idProvider")]
internal static class IdProvider
{
[Template("System.Threading.Tasks.Task.fromPromise({this}.isLoginRedirect(), 0)")] // <<<<< Add 0 here
public static extern Task<bool> IsLoginRedirect();
}
from h5.
No worries, I was also not aware of it 😅
from h5.
Related Issues (20)
- FieldBlock: Convert.ChangeType is failed.
- Regression: negative zero is compiled wrong
- Building issues on multiple platforms HOT 11
- Compilation error for null-conditional operator and comparison (value?.Count > 0) HOT 4
- Extremely high RAM consumption in solution with multiple H5 projects. HOT 3
- Typescript definition generation fails for ObjectLiteral fields
- This page is not available HOT 4
- [Help] How to use with MonoGame? HOT 1
- How do I access Bridge.Html5.Document.GetElementById? HOT 5
- H5 wont build in Jenkins with MSBUILD HOT 2
- Deserialize H5 Newtownsoft Json to deserialize a derived type class? HOT 3
- H5 does not respect CamelCasePropertyNamesContractResolver HOT 7
- IReadOnlyCollection is not handled in System.Arrat.getCount HOT 1
- Embedded Resources in H5?
- Consider migration to Gitlab? HOT 5
- Local functions No build HOT 1
- h5 devs didn't think about non-browser envs
- not support SortedDictionary? HOT 2
- Error using Newtonsoft.Json in H5 project after serialization HOT 1
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 h5.