We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c9d99c commit 56c7034Copy full SHA for 56c7034
src/svg/svg-generator.ts
@@ -70,13 +70,17 @@ export default class SvgGenerator {
70
};
71
72
private generateLines = async (): Promise<string> => {
73
- let res = "";
+ const promises: Promise<string>[] = [];
74
75
for (const line of this.card.getLinesMap()) {
76
- res += await this.createLine(line[1], line[0]);
+ promises.push(this.createLine(line[1], line[0]));
77
}
78
79
- return res;
+ const resolved = await Promise.all(promises);
80
+
81
+ return resolved.reduce((res, line) => {
82
+ return (res += line);
83
+ }, "");
84
85
86
private createLine = async (
0 commit comments