UNPKG

stitch-ui

Version:

30 lines (28 loc) 668 B
import { Record } from "immutable"; import JSONState from "./JSONState"; import PipelineStageEditState from "./PipelineStageEditState"; export default class PipelineStage extends Record({ service: "", action: "", args: {}, let: undefined }) { toRaw() { return { service: this.service, action: this.action, args: this.args, let: this.let }; } toEditState() { return new PipelineStageEditState({ service: this.service, action: this.action, argsInput: JSONState.fromRaw(this.args || {}), letInput: JSONState.fromRaw(this.let || {}), letEnabled: !!this.let, dirty: false }); } }