feat: let promise reject called
This commit is contained in:
@@ -136,12 +136,12 @@ export class Context {
|
||||
}
|
||||
callNative(namespace: string, method: string, args?: any): Promise<any> {
|
||||
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: Object) {
|
||||
|
@@ -174,12 +174,12 @@ export class Context {
|
||||
}
|
||||
callNative(namespace: string, method: string, args?: any): Promise<any> {
|
||||
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: Object) {
|
||||
|
Reference in New Issue
Block a user