From 13cf5bd583251a049b051dffef36c4b30e780ef4 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 21 Aug 2018 15:34:20 +0100 Subject: [PATCH] Add Blazor.onServerConnectionClose to fix #1339 This API will be removed once we implement proper connection management (reconnects, etc.) --- src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.Server.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.Server.ts b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.Server.ts index 0efbe4e161..8880476f9d 100644 --- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.Server.ts +++ b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.Server.ts @@ -47,6 +47,10 @@ function boot() { ); }) .catch(unhandledError); + + // Temporary undocumented API to help with https://github.com/aspnet/Blazor/issues/1339 + // This will be replaced once we implement proper connection management (reconnects, etc.) + window['Blazor'].onServerConnectionClose = connection.onclose.bind(connection); } function unhandledError(err) {