Skip to content

postMessage and addEventListener once #18

@ahmader

Description

@ahmader

window.addEventListener('message', receiveMessage, {
once: true,
});

Because I am running Vue dev-tools, and it is sending messages for hot reload, I was confused. Sometimes I receive the token and most of the time I was not.

After debugging I've found adding once was not a good idea, instead I removeEventListener after receiving the token.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions