diff options
Diffstat (limited to 'src/util/helpers.ts')
-rw-r--r-- | src/util/helpers.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/helpers.ts b/src/util/helpers.ts index 99d046f04..8136f44fa 100644 --- a/src/util/helpers.ts +++ b/src/util/helpers.ts @@ -214,3 +214,13 @@ export function strcmp(s1: string, s2: string): number { } return 0; } + +/** + * Run a function and return its result. + * + * Used as a nicer-looking way to do immediately invoked function + * expressions (IFFEs). + */ +export function runBlock<T>(f: () => T) { + return f(); +}
\ No newline at end of file |