js,vfmt: fix formatting for JS types; add fetch API (#12608)

This commit is contained in:
playX 2021-11-29 16:32:29 +03:00 committed by GitHub
parent 9825c7e06c
commit ddec89f9ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 61 additions and 23 deletions

View file

@ -68,12 +68,14 @@ pub fn JS.Promise.all(JS.Array) JS.Promise
pub fn JS.Promise.allSettled(JS.Array) JS.Promise
/*
pub type JsAny = JS.Any
// all takes an iterable of promises as an input, and returns a single Promise that resolves to an array of
// the results of the input promises
pub fn all(array []JS.Promise) Promise<JS.Array, JS.Any> {
pub fn all(array []JS.Promise) Promise<JS.Array, js.promise.JsAny> {
mut promise := JS.Promise(JS.Any(voidptr(0)))
#promise = Promise.all(array.arr.arr);
return Promise<Array,Any>{promise}
return Promise<JS.Array,JsAny>{promise}
}
*/