mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 04:43:35 +00:00
refactor: pad block row with extra columns
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user