Explorar el Código

Assign the Skeletor Events API to CustomElement

So that components can use `listenTo`
JC Brand hace 5 años
padre
commit
2cb1af3dea
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  1. 11 0
      src/components/element.js

+ 11 - 0
src/components/element.js

@@ -1,9 +1,20 @@
 import { LitElement } from 'lit-element';
+import { Events } from '@converse/skeletor/src/events.js';
+
 
 export class CustomElement extends LitElement {
 
+    constructor () {
+        super();
+        Object.assign(this, Events);
+    }
+
     createRenderRoot () {
         // Render without the shadow DOM
         return this;
     }
+
+    disconnectedCallback () {
+        this.stopListening();
+    }
 }