fix(core): update
This commit is contained in:
parent
4e7c28ac83
commit
f2a85d4719
@ -49,7 +49,7 @@ export class ReactionRequest<T extends plugins.typedrequestInterfaces.ITypedRequ
|
||||
request: requestDataArg,
|
||||
response: null
|
||||
}
|
||||
}
|
||||
};
|
||||
channel.sendMessage({
|
||||
messageText: 'reactionRequest',
|
||||
payload
|
||||
|
@ -16,11 +16,26 @@ export class ReactionResult<T extends plugins.typedrequestInterfaces.ITypedReque
|
||||
return this.resultSubject.subscribe(observerArg);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the end result as an array of all results
|
||||
*/
|
||||
public async getEndResult() {
|
||||
const result = await this.completeDeferred.promise;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* if there is a single respondant, or you are only interested in the first result
|
||||
*/
|
||||
public async getFirstResult() {
|
||||
const done = plugins.smartpromise.defer<T['response']>();
|
||||
const subscription = this.resultSubject.subscribe(result => {
|
||||
done.resolve(result);
|
||||
subscription.unsubscribe();
|
||||
});
|
||||
return await done.promise;
|
||||
}
|
||||
|
||||
/**
|
||||
* push a reactionResponse
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user