UNPKG

react-dayo

Version:

A Queue component for notification etc

55 lines 2.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var step_1 = require("./constants/step"); var Cycle = /** @class */ (function () { function Cycle() { var _this = this; this.step = step_1.Step.Enter; this.skiped = false; this.proceed = function () { switch (_this.step) { case step_1.Step.Enter: { _this.step = step_1.Step.Entering; break; } case step_1.Step.Entering: { _this.step = step_1.Step.Entered; break; } case step_1.Step.Entered: { _this.step = step_1.Step.Exit; break; } case step_1.Step.Exit: { _this.step = step_1.Step.Exiting; break; } case step_1.Step.Exiting: { _this.step = step_1.Step.Exited; break; } case step_1.Step.Exited: default: { break; } } }; this.isSkip = function () { return _this.skiped; }; this.isEnter = function () { return _this.step === step_1.Step.Enter; }; this.isEntering = function () { return _this.step === step_1.Step.Entering; }; this.isEntered = function () { return _this.step === step_1.Step.Entered; }; this.isExit = function () { return _this.step === step_1.Step.Exit; }; this.isExiting = function () { return _this.step === step_1.Step.Exiting; }; this.isExited = function () { return _this.step === step_1.Step.Exited; }; } Cycle.prototype.skip = function () { this.skiped = true; }; Cycle.prototype.getCurrentStep = function () { return this.step; }; return Cycle; }()); exports.Cycle = Cycle; exports.default = Cycle; //# sourceMappingURL=cycle.js.map