Emit warnings after off is called (#1513)

* Emit warnings after off is called

If a handler has been registered, and then gets unregistered, the key/methodname still exists in the map and signalr does not warn about a missing handler. Might be by design, but I like it this way.
This commit is contained in:
Olof Dahlbom 2018-02-28 19:10:13 +01:00 committed by David Fowler
parent 5cc4f315cb
commit c4eb501343
1 changed files with 3 additions and 0 deletions

View File

@ -267,6 +267,9 @@ export class HubConnection {
const removeIdx = handlers.indexOf(method);
if (removeIdx !== -1) {
handlers.splice(removeIdx, 1);
if (handlers.length === 0) {
this.methods.delete(methodName);
}
}
}