Skip to content
Snippets Groups Projects
Unverified Commit afb74c33 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Improve debug logging and added composed to events (dbp/apps/library#77)

parent c4a9e0d1
No related branches found
No related tags found
No related merge requests found
Pipeline #15578 passed
...@@ -11,7 +11,7 @@ export class AdapterLitElement extends LitElement { ...@@ -11,7 +11,7 @@ export class AdapterLitElement extends LitElement {
this.subscribe = ''; this.subscribe = '';
this.unsubscribe = ''; this.unsubscribe = '';
console.log('AdapterLitElement constructor()'); console.log('AdapterLitElement(' + this.tagName + ') constructor()');
} }
connectedCallback() { connectedCallback() {
...@@ -34,7 +34,7 @@ export class AdapterLitElement extends LitElement { ...@@ -34,7 +34,7 @@ export class AdapterLitElement extends LitElement {
} }
subscribeProviderFor(element) { subscribeProviderFor(element) {
console.log('AdapterLitElement subscribeProviderFor( ' + element + ' )'); console.log('AdapterLitElement(' + this.tagName + ') subscribeProviderFor( ' + element + ' )');
const pair = element.trim().split(':'); const pair = element.trim().split(':');
const local = pair[0]; const local = pair[0];
const global = pair[1]; const global = pair[1];
...@@ -42,10 +42,11 @@ export class AdapterLitElement extends LitElement { ...@@ -42,10 +42,11 @@ export class AdapterLitElement extends LitElement {
const event = new CustomEvent('subscribe', const event = new CustomEvent('subscribe',
{ {
bubbles: true, bubbles: true,
composed: true,
detail: { detail: {
name: global, name: global,
callback: (value) => { callback: (value) => {
console.log('AdapterLitElement() sub/Callback ' + global + ' -> ' + local + ' = ' + value); console.log('AdapterLitElement(' + this.tagName + ') sub/Callback ' + global + ' -> ' + local + ' = ' + value);
this.attributeChangedCallback(local, that[local], value); this.attributeChangedCallback(local, that[local], value);
}, },
sender: this, sender: this,
...@@ -55,12 +56,13 @@ export class AdapterLitElement extends LitElement { ...@@ -55,12 +56,13 @@ export class AdapterLitElement extends LitElement {
} }
unSubscribeProviderFor(element) { unSubscribeProviderFor(element) {
console.log('AdapterLitElement unSubscribeProviderFor( ' + element + ' )'); console.log('AdapterLitElement(' + this.tagName + ') unSubscribeProviderFor( ' + element + ' )');
const pair = element.trim().split(':'); const pair = element.trim().split(':');
const global = pair[1]; const global = pair[1];
const event = new CustomEvent('unsubscribe', const event = new CustomEvent('unsubscribe',
{ {
bubbles: true, bubbles: true,
composed: true,
detail: { detail: {
name: global, name: global,
sender: this, sender: this,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment