You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/ui-v2/app/components/dom-buffer-flush.js

21 lines
554 B

import { inject as service } from '@ember/service';
import Component from '@ember/component';
const append = function(content) {
this.element.appendChild(content);
};
export default Component.extend({
buffer: service('dom-buffer'),
init: function() {
this._super(...arguments);
this.append = append.bind(this);
},
didInsertElement: function() {
this._super(...arguments);
this.buffer.on('add', this.append);
},
didDestroyElement: function() {
this._super(...arguments);
this.buffer.off('add', this.append);
},
});