UNPKG

ngrx-uml

Version:
34 lines (33 loc) 975 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Reducer = void 0; const path_1 = __importDefault(require("path")); const models_1 = require("../../core/converters/models"); class Reducer { constructor(filePath, pos, end) { this.filePath = filePath; this.pos = pos; this.end = end; this.kind = models_1.TypeKind.Reducer; this.kindText = 'Reducer'; } setName(name) { this.name = name; } getExportName() { return `${this.filePath && path_1.default.basename(this.filePath, '.ts')}_${this.name}`; } addAction(action) { if (!this.actions) { this.actions = []; } this.actions.push(action); } getChildren() { return this.actions || []; } } exports.Reducer = Reducer;