ソースを参照

Assign the Skeletor Events API to CustomElement

So that components can use `listenTo`
JC Brand 5 年 前
コミット
2cb1af3dea
1 ファイル変更11 行追加0 行削除
  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();
+    }
 }