Refactor: simplify build infra

This commit is contained in:
SukkaW
2023-12-16 22:05:58 +08:00
parent 8519b216cd
commit 9eda90e85b
9 changed files with 306 additions and 12 deletions

View File

@@ -0,0 +1,7 @@
export const createMemoizedPromise = <T>(fn: () => Promise<T>): () => Promise<T> => {
let promise: Promise<T> | null = null;
return () => {
promise ||= fn();
return promise;
};
};