Skip to content

Commit bb1b9e4

Browse files
committed
feat: refine async
1 parent ff9b2ca commit bb1b9e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/builders/src/mixins/Refineable.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ export class Refineable {
1313
* .setTitle('Hello World')
1414
* .setDescription('This is a description')
1515
* .refine((b) => {
16+
* const intermediateValue = computeSomething();
17+
* b.setFooter(`Computed value: ${intermediateValue}`);
1618
* if (externalVariable) {
17-
* b.setColor('Red');
19+
* b.setColor(0xff0000);
1820
* }
1921
* });
2022
* ```
@@ -23,4 +25,9 @@ export class Refineable {
2325
fn(this);
2426
return this;
2527
}
28+
29+
public async refineAsync(fn: (builder: this) => Promise<void>): Promise<this> {
30+
await fn(this);
31+
return this;
32+
}
2633
}

0 commit comments

Comments
 (0)