@datagrok-libraries/utils
Advanced tools
Comparing version 4.1.24 to 4.1.25
@@ -11,3 +11,3 @@ { | ||
"fullName": "Utils", | ||
"version": "4.1.24", | ||
"version": "4.1.25", | ||
"description": "Common utilities", | ||
@@ -14,0 +14,0 @@ "dependencies": { |
@@ -16,3 +16,8 @@ import './u2.css'; | ||
function appHeader(header: IAppInfo): HTMLElement; | ||
namespace tools { | ||
/** Executes {@link func} while showing the "running" indicator on {@link root}. | ||
* Handles and logs exceptions. */ | ||
function runAsync<T>(root: HTMLElement, func: () => Promise<T>): Promise<T | undefined>; | ||
} | ||
} | ||
//# sourceMappingURL=u2.d.ts.map |
@@ -0,2 +1,12 @@ | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
import * as ui from 'datagrok-api/ui'; | ||
import * as grok from 'datagrok-api/grok'; | ||
import $ from 'cash-dom'; | ||
@@ -32,3 +42,23 @@ import './u2.css'; | ||
u2.appHeader = appHeader; | ||
let tools; | ||
(function (tools) { | ||
/** Executes {@link func} while showing the "running" indicator on {@link root}. | ||
* Handles and logs exceptions. */ | ||
function runAsync(root, func) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
ui.setUpdateIndicator(root, true); | ||
try { | ||
return yield func(); | ||
} | ||
catch (e) { | ||
grok.log.error(e); | ||
} | ||
finally { | ||
ui.setUpdateIndicator(root, false); | ||
} | ||
}); | ||
} | ||
tools.runAsync = runAsync; | ||
})(tools = u2.tools || (u2.tools = {})); | ||
})(u2 || (u2 = {})); | ||
//# source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gICAgICAgIHJldHVybiBhd2FpdCBmdW5jKCk7XG4gICAgICB9XG4gICAgICBjYXRjaCAoZSkge1xuICAgICAgICBncm9rLmxvZy5lcnJvcihlIGFzIHN0cmluZyk7XG4gICAgICB9XG4gICAgICBmaW5hbGx5IHtcbiAgICAgICAgdWkuc2V0VXBkYXRlSW5kaWNhdG9yKHJvb3QsIGZhbHNlKTtcbiAgICAgIH1cbiAgICB9XG4gIH1cbn0iXX0= |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
453440
3333