fix(Collector): docs and types (#5937)

This commit is contained in:
Jan
2021-06-29 01:37:45 +02:00
committed by GitHub
parent 41f718f779
commit 6c447b12e3
4 changed files with 17 additions and 17 deletions

View File

@@ -95,7 +95,7 @@ class Collector extends EventEmitter {
* @emits Collector#collect
*/
async handleCollect(...args) {
const collect = this.collect(...args);
const collect = await this.collect(...args);
if (collect && (await this.filter(...args, this.collected))) {
this.collected.set(collect, args[0]);
@@ -269,7 +269,7 @@ class Collector extends EventEmitter {
* be collected, or returns an object describing the data that should be stored.
* @see Collector#handleCollect
* @param {...*} args Any args the event listener emits
* @returns {?{key, value}} Data to insert into collection, if any
* @returns {?(*|Promise<?*>)} Data to insert into collection, if any
* @abstract
*/
collect() {}