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.

21 lines 908 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.forwardStep = void 0; var forwardStep = function (args) { return function () { if (args.poppedHistory.length !== 0) { var previousStep_1 = args.poppedHistory[args.poppedHistory.length - 1]; args.setPoppedHistory(function (ps) { return __spreadArrays(ps.slice(0, -1)); }); args.setHistory(function (ps) { return __spreadArrays(ps, [previousStep_1]); }); return; } return; }; }; exports.forwardStep = forwardStep; //# sourceMappingURL=forwardStep.js.map