datalovelace/src/Controllers/NoduleListController.js
2020-07-22 22:47:34 -05:00

20 lines
448 B
JavaScript

import Nodules from '../Models/Nodules'
class NoduleistController {
constructor() {
this.nodules = new Nodules()
this.updatedNodulesEvent = new Event('updateNodules')
}
deleteNodule = id => {
this.nodules.removeById(id)
document.dispatchEvent(this.updatedNodulesEvent)
}
logExportById = id => {
const nodule = this.nodules.getNoduleById(id)
console.log(nodule.export())
}
}
export default NoduleistController