UNPKG

use-wizard

Version:

A dead-easy-to-use light-weight react hook to handle multi-paths wizards (and simple wizards too) and navigate into them.

18 lines 812 B
"use strict"; var __spreadArrays = (this && this.__spreadArrays) || function () { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.jumpSteps = void 0; var jumpSteps = function (args) { return function (jump) { if (args.wizardType !== "linearN") return console.log("Wizard warning: steps-jumping does not work with this kind of wizard"); args.setHistory(function (ps) { return __spreadArrays(ps, [ps[ps.length - 1] + jump]); }); return; }; }; exports.jumpSteps = jumpSteps; //# sourceMappingURL=jumpSteps.js.map