Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
8eff93febc | |||
11f731aa61 | |||
a8e7d2f335 | |||
219390e895 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@design.estate/dees-element",
|
||||
"version": "2.0.31",
|
||||
"version": "2.0.33",
|
||||
"private": false,
|
||||
"description": "a custom element class extending lit element class",
|
||||
"main": "dist_ts/index.js",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@design.estate/dees-element',
|
||||
version: '2.0.31',
|
||||
version: '2.0.33',
|
||||
description: 'a custom element class extending lit element class'
|
||||
}
|
||||
|
@ -40,12 +40,20 @@ export class DeesElement extends plugins.lit.LitElement {
|
||||
this.elementDomReadyDeferred.resolve();
|
||||
}
|
||||
|
||||
private garbageFunctions: (() => void)[] = [];
|
||||
public registerGarbageFunction(garbageFunctionArg: () => void) {
|
||||
this.garbageFunctions.push(garbageFunctionArg);
|
||||
}
|
||||
|
||||
public async disconnectedCallback() {
|
||||
await this.domtoolsPromise;
|
||||
super.disconnectedCallback();
|
||||
for (const subscription of this.rxSubscriptions) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
for (const garbageFunction of this.garbageFunctions) {
|
||||
garbageFunction();
|
||||
}
|
||||
this.dispatchEvent(new CustomEvent('deesElementDisconnected'));
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,8 @@
|
||||
"experimentalDecorators": true,
|
||||
"useDefineForClassFields": false,
|
||||
"target": "ES2022",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "nodenext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
|
Reference in New Issue
Block a user