constructor({ fromTask, toTask, id = uniqueId('arrow_') }) { invariant(fromTask instanceof Task && toTask instanceof Task, 'Arrow requires `to` and `from` to be Task instances.'); invariant(fromTask !== toTask, '`fromTask` and `toTask` in Arrow Model must be unique.'); extendObservable(this, { fromTask, toTask }); this.id = id; }
constructor() { extendObservable(this, { tasks: [], arrows: [], selectedTask: null, windowDimensions: this.getWindowDimesions() }); window.addEventListener('resize', () => { this.windowDimensions = this.getWindowDimesions(); }, false); }
constructor({ x, y, name, id = uniqueId('task_') }) { const taskName = name ? name : id; extendObservable(this, { x, y, name: taskName }); this.id = id; }