From fa4621e70c48500a372504eb8ae9b9481531c555 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 16 Dec 2019 12:53:22 +0100 Subject: history events WIP --- src/util/helpers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/util/helpers.ts') 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(f: () => T) { + return f(); +} \ No newline at end of file -- cgit v1.2.3