Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

JS/TS client HubConnection.onClosed should be a method instead of a property #842

@davidfowl

Description

@davidfowl

It should be possible to wire up multiple handlers to the closed event. We could even consider using on instead of having special events. That does mean we would need reserved names but it would be less concepts.

Today:

let http = new signalR.HttpConnection(document.location.protocol + '//' + document.location.host + '/chat');
let connection = new signalR.HubConnection(http);

connection.onClosed = e => {
        
};

Proposal:

let http = new signalR.HttpConnection(document.location.protocol + '//' + document.location.host + '/chat');
let connection = new signalR.HubConnection(http);

connection.on('close', e => {
        
});

We could also change the nomenclature and use connect/disconnect like the server side does.

/cc @moozzyk

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions