feat: let promise reject called
This commit is contained in:
@@ -1298,12 +1298,12 @@ var doric = (function (exports) {
|
||||
Context.prototype.callNative = function (namespace, method, args) {
|
||||
var _this = this;
|
||||
var callbackId = uniqueId('callback');
|
||||
nativeBridge(this.id, namespace, method, callbackId, args);
|
||||
return new Promise(function (resolve, reject) {
|
||||
_this.callbacks.set(callbackId, {
|
||||
resolve: resolve,
|
||||
reject: reject,
|
||||
});
|
||||
nativeBridge(_this.id, namespace, method, callbackId, args);
|
||||
});
|
||||
};
|
||||
Context.prototype.register = function (instance) {
|
||||
|
@@ -1300,12 +1300,12 @@ var doric = (function (exports) {
|
||||
}
|
||||
callNative(namespace, method, args) {
|
||||
const callbackId = uniqueId('callback');
|
||||
nativeBridge(this.id, namespace, method, callbackId, args);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.callbacks.set(callbackId, {
|
||||
resolve,
|
||||
reject,
|
||||
});
|
||||
nativeBridge(this.id, namespace, method, callbackId, args);
|
||||
});
|
||||
}
|
||||
register(instance) {
|
||||
|
@@ -1329,12 +1329,12 @@ class Context {
|
||||
}
|
||||
callNative(namespace, method, args) {
|
||||
const callbackId = uniqueId('callback');
|
||||
nativeBridge(this.id, namespace, method, callbackId, args);
|
||||
return new Promise((resolve, reject) => {
|
||||
this.callbacks.set(callbackId, {
|
||||
resolve,
|
||||
reject,
|
||||
});
|
||||
nativeBridge(this.id, namespace, method, callbackId, args);
|
||||
});
|
||||
}
|
||||
register(instance) {
|
||||
|
Reference in New Issue
Block a user