Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(broadcaster): remove refcount as we already made it a singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuawilson committed Jul 13, 2018
1 parent d14435e commit e049222
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/app/broadcaster.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ describe('Service: Broadcaster service', () => {

afterEach( () => {
broadcaster = null;
Broadcaster.refCount = 0;
});

it('Broadcaster can successfully send and receive messages', (done) => {
Expand Down
5 changes: 0 additions & 5 deletions src/app/broadcaster.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@ interface BroadcastEvent {
})
export class Broadcaster {
private _eventBus: Subject<BroadcastEvent>;
public static refCount: number = 1;

constructor() {
this._eventBus = new Subject<BroadcastEvent>();
Broadcaster.refCount++;
if (Broadcaster.refCount > 1) {
throw new Error('Multiple broadcaster instances detected, this is a fatal error.');
}
}

/**
Expand Down

0 comments on commit e049222

Please sign in to comment.