github.com/outbrain/consul@v1.4.5/ui-v2/app/components/dom-buffer.js (about)

     1  import { inject as service } from '@ember/service';
     2  import { get } from '@ember/object';
     3  import Component from '@ember/component';
     4  export default Component.extend({
     5    buffer: service('dom-buffer'),
     6    getBufferName: function() {
     7      // TODO: Right now we are only using this for the modal layer
     8      // moving forwards you'll be able to name your buffers
     9      return 'modal';
    10    },
    11    didInsertElement: function() {
    12      get(this, 'buffer').add(this.getBufferName(), this.element);
    13    },
    14    didDestroyElement: function() {
    15      get(this, 'buffer').remove(this.getBufferName());
    16    },
    17  });