refactor: pad block row with extra columns

This commit is contained in:
arc-alex
2025-02-19 15:03:10 +01:00
committed by Carlos Valente
parent e5b30770ce
commit 4a16378786
3 changed files with 36 additions and 4 deletions
@@ -0,0 +1,12 @@
/**
* Allows lazy evaluation and caching of a functions result
*/
export function lazyEvaluate<T>(fn: () => T): () => T {
let result: T | undefined;
return function () {
if (result === undefined) {
result = fn();
}
return result;
};
}