Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit 417ffa8

Browse files
committed
feat: rename Socketio to Socket
1 parent ee710fc commit 417ffa8

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

projects/ngx-socketio2/src/lib/socketio.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ModuleWithProviders, NgModule } from '@angular/core';
22
import { SocketioConfig } from './socketio.interface';
3-
import { Socketio } from './socketio.service';
3+
import { Socket } from './socketio.service';
44
import { SOCKETIO_CONFIG } from './socketio.token';
55

66
@NgModule()
@@ -10,7 +10,7 @@ export class SocketioModule {
1010
ngModule: SocketioModule,
1111
providers: [
1212
{ provide: SOCKETIO_CONFIG, useValue: config },
13-
{ provide: Socketio, useClass: Socketio },
13+
{ provide: Socket, useClass: Socket },
1414
],
1515
};
1616
}

projects/ngx-socketio2/src/lib/socketio.service.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { TestBed } from '@angular/core/testing';
2-
import { Socketio } from './socketio.service';
2+
import { Socket } from './socketio.service';
33

4-
describe('Socketio', () => {
5-
let service: Socketio;
4+
describe('Socket', () => {
5+
let service: Socket;
66

77
beforeEach(() => {
88
TestBed.configureTestingModule({});
9-
service = TestBed.inject(Socketio);
9+
service = TestBed.inject(Socket);
1010
});
1111

1212
it('should be created', () => {

projects/ngx-socketio2/src/lib/socketio.service.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { Inject, Injectable, OnDestroy } from '@angular/core';
22
import { fromEvent, Observable } from 'rxjs';
33
import { FromEventTarget } from 'rxjs/internal/observable/fromEvent';
44
import { take } from 'rxjs/operators';
5-
import { io, Manager, Socket } from 'socket.io-client';
5+
import { io, Manager, Socket as _Socket } from 'socket.io-client';
66
import { SocketioConfig } from './socketio.interface';
77
import { SOCKETIO_CONFIG } from './socketio.token';
88

99
@Injectable()
10-
export class Socketio implements OnDestroy {
11-
private socket: Socket;
10+
export class Socket implements OnDestroy {
11+
private socket: _Socket;
1212

1313
/**
1414
* @see {@link Socket.id}
@@ -33,8 +33,11 @@ export class Socketio implements OnDestroy {
3333
/**
3434
* @see {@link Socket.auth}
3535
*/
36-
get auth(): Socket['auth'] { return this.socket.auth };
37-
set auth(auth: Socket['auth']) { this.socket.auth = auth };
36+
get auth(): _Socket['auth'] { return this.socket.auth };
37+
/**
38+
* @see {@link Socket.auth}
39+
*/
40+
set auth(auth: _Socket['auth']) { this.socket.auth = auth };
3841

3942
constructor(
4043
@Inject(SOCKETIO_CONFIG) { url, options }: SocketioConfig

projects/ngx-socketio2/src/public-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44

55
export * from './lib/socketio.module';
66
export * from './lib/socketio.service';
7-

0 commit comments

Comments
 (0)