Promise
Promise 对象表示异步操作最终的完成(或失败)以及其结果值。仅 HBuilderX 3.9+ 安卓平台支持。
Constructor(fn)
Constructor(fn)_1
实例方法
then()
then(onFulfilled, onRejected?)_1
then(onFulfilled, onRejected?)_2
then(onFulfilled, onRejected?)_3
then(onFulfilled, onRejected?)_4
catch()
catch(onRejected)_1
catch(onRejected)_2
catch(onRejected)_3
catch(onRejected)_4
finally(callback)
resolve()
resolve(value)_1
resolve(value)_2
reject(value?)
all(arr)
race(arr)
any(arr)
allSettled(arr)
Bug & Tips
- 目前 Promise 类型编译到 kotlin 为 io.dcloud.uts.UTSPromise