open-consul/ui-v2/app/components/data-writer/index.js
2020-07-09 10:08:47 +01:00

26 lines
605 B
JavaScript

import Component from '@ember/component';
import { set } from '@ember/object';
import Slotted from 'block-slots';
import chart from './chart.xstate';
export default Component.extend(Slotted, {
tagName: '',
ondelete: function() {
return this.onchange(...arguments);
},
onchange: function() {},
init: function() {
this._super(...arguments);
this.chart = chart;
},
actions: {
persist: function(data, e) {
if (e && typeof e.preventDefault === 'function') {
e.preventDefault();
}
set(this, 'data', data);
this.dispatch('PERSIST');
},
},
});