Skip to content

Can't Expand Object that Extends EventTarget #953

@aronduby

Description

@aronduby

I have a js class that extends EventTarget to take advantage of js's built in event handling, but when I view an instance of that item in the component inspector it just says EventTarget and I'm unable to expand it or interact with it in anyway. Is there a way to get this to retain that functionality while extending that class?

Image
class Dialog extends EventTarget {
    // ...
}

class DialogService {

    /**
     * Internal reference to the existing dialogs
     */
    public readonly instanceMap: Map<string, Dialog>;

    constructor() {
        this.instanceMap = reactive(new Map());
    }

    add(dialog: Dialog) {
        this.instanceMap.set(dialog.id, dialog);
        dialog.addEventListener('transitioned', () => this.remove(dialog);
    }

    // ...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions