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 891 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.previousStep = void 0; var previousStep = function (args) { return function () { if (args.history.length > 1) { var currentStep_1 = args.history[args.history.length - 1]; args.setHistory(function (ps) { return __spreadArrays(ps.slice(0, -1)); }); args.setPoppedHistory(function (ps) { return __spreadArrays(ps, [currentStep_1]); }); return; } return; }; }; exports.previousStep = previousStep; //# sourceMappingURL=previousStep.js.map