molstar
Version:
A comprehensive macromolecular library.
15 lines • 727 B
JavaScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author David Sehnal <david.sehnal@gmail.com>
*/
import { __awaiter, __generator } from "tslib";
import { Task } from '../task';
function MultistepTask(name, steps, f, onAbort) {
var _this = this;
return function (params) { return Task.create(name, function (ctx) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
return [2 /*return*/, f(params, function (n) { return ctx.update({ message: "" + steps[n], current: n + 1, max: steps.length }); }, ctx)];
}); }); }, onAbort); };
}
export { MultistepTask };
//# sourceMappingURL=multistep.js.map