Aspnetcore.docs: document `HubConnection.onclose(callback);`

Created on 14 Aug 2018  Â·  8Comments  Â·  Source: dotnet/AspNetCore.Docs

There seems to be no documentation on HubConnection.onclose(callback);.

https://github.com/aspnet/SignalR/blob/fc8979aecab257c1d837ccfab0f6694e4f2e9179/clients/ts/signalr/src/HubConnection.ts#L275

Also, if there are samples for client automatically reconnecting? I couldn't find them. I was porting from server-sent-events (aka new EventSource(url)) which provides automatic reconnect (by the browser/platform).


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Source - Docs.ms

All 8 comments

There is a link to the JavaScript API in the Table Of Contents although it would probably be useful to link it in the javascript-client doc too.

@BrennanConroy I'll take care of adding that link.

@yzorg Does this help you? https://docs.microsoft.com/en-us/javascript/api/%40aspnet/signalr/hubconnection?view=signalr-js-latest#onclose

@scottaddie Yes!

I didn't notice it in the MS docs table of contents, but I did look for it on NPM page for the JS/TS client. The NPM page links here.

Consider adding a link from the NPM page to the detailed JS API docs?

@BrennanConroy Any interest in adding a JS API ref link on the npm package page? Not sure who owns that.

Sounds good, we can look at doing this for 2.2.0 (we own that page, it is from https://github.com/aspnet/SignalR/blob/release/2.2/clients/ts/signalr/README.md)

@scottaddie After thinking about it for 24 hours... I ask you to consider onclose() for attention in the JS client docs page.

Do you think a section about handling disconnect/reconnect is unique to me, or do you think it might be common enough to cover in the main docs?

Of course it would change when SignalR clients get automatic reconnection feature, aspnet/SignalR#1057. (At which point I assume disconnect/reconnect would need to be covered in the docs.)

6757 is tracking reconnect documentation.

Was this page helpful?
0 / 5 - 0 ratings