Fix typos

This commit is contained in:
Thomas Nordquist
2019-06-19 11:56:09 +02:00
parent 7e99c18410
commit 0d585eef8f
7 changed files with 20 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ describe('Edge', () => {
expect(e.name).to.equal('foo')
})
it('firstEdge should retireve the first edge', () => {
it('firstEdge should retrieve the first edge', () => {
const topics = 'foo/bar/baz'.split('/')
const leaf = TreeNodeFactory.fromEdgesAndValue(topics, undefined)
const bazEdge = leaf.sourceEdge

View File

@@ -20,9 +20,9 @@ describe('EventDispatcher', async () => {
it('should unsubscribe', async function() {
const dispatcher = new EventDispatcher<string, string>()
this.timeout(300)
let incrementee = 0
let callbackCounter = 0
const callback = (msg: any) => {
incrementee += 1
callbackCounter += 1
}
dispatcher.subscribe(callback)
@@ -36,6 +36,6 @@ describe('EventDispatcher', async () => {
// should not cause any increment
dispatcher.dispatch('hello')
expect(incrementee).to.eq(1)
expect(callbackCounter).to.eq(1)
})
})

View File

@@ -62,17 +62,17 @@ export class ConnectionManager {
})
}
public removeConnection(conenctionId: string) {
const connection = this.connections[conenctionId]
public removeConnection(connectionId: string) {
const connection = this.connections[connectionId]
if (connection) {
backendEvents.unsubscribeAll(makePublishEvent(conenctionId))
backendEvents.unsubscribeAll(makePublishEvent(connectionId))
connection.disconnect()
delete this.connections[conenctionId]
delete this.connections[connectionId]
connection.stateMachine.onUpdate.removeAllListeners()
}
}
public closeAllConnections() {
Object.keys(this.connections).forEach(conenctionId => this.removeConnection(conenctionId))
Object.keys(this.connections).forEach(connectionId => this.removeConnection(connectionId))
}
}