MCPcopy
hub / github.com/ever-co/ever-demand / constructor

Method constructor

packages/common-angular/src/lib/socket.service.ts:64–88  ·  view source on GitHub ↗
(
		private readonly socketUrl: string,
		private readonly io: typeof _io
	)

Source from the content-addressed store, hash-verified

62 );
63
64 constructor(
65 private readonly socketUrl: string,
66 private readonly io: typeof _io
67 ) {
68 console.log(`Socket with url ${socketUrl} created!`);
69
70 const ioCallable = <any>this.io;
71
72 this.ioSocket = ioCallable(`${this.socketUrl}`, {
73 reconnection: false,
74 });
75
76 this.connectionStatus
77 .pipe(
78 filter(
79 (status) =>
80 status === ConnectionStatus.Disconnected ||
81 status === ConnectionStatus.ConnectError
82 ),
83 delay(1000)
84 )
85 .subscribe(() => {
86 this.connect();
87 });
88 }
89
90 on(eventName: string, callback: () => void) {
91 this.ioSocket.on(eventName, callback);

Callers

nothing calls this directly

Calls 2

connectMethod · 0.95
logMethod · 0.80

Tested by

no test coverage detected