Skip to content

Commit d1aaaaf

Browse files
committed
Release v4.5.1
1 parent 3963f65 commit d1aaaaf

File tree

4 files changed

+70
-2
lines changed

4 files changed

+70
-2
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [4.5.1] - 2023-05-11
9+
10+
### Added
11+
12+
- `listeners` Method.
13+
- `listenersAny` Method.
14+
- `listenersAnyOutgoing` Method.
15+
- `off` Method.
16+
- `onAny` Method.
17+
- `onAnyOutgoing` Method.
18+
- `prependAny` Method.
19+
- `prependAnyOutgoing` Method.
20+
- `timeout` Method.
21+
- `volatile` Method.
22+
823
## [4.5.0] - 2023-05-11
924

1025
### Added

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngx-socket-io",
3-
"version": "4.5.0",
3+
"version": "4.5.1",
44
"description": "Socket.IO module for Angular",
55
"main": "index.ts",
66
"scripts": {

src/socket-io.service.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,57 @@ export class WrappedSocket {
8383
fromOneTimeEvent<T>(eventName: string): Promise<T> {
8484
return new Promise<T>(resolve => this.once(eventName, resolve));
8585
}
86+
87+
listeners(eventName: string) {
88+
return this.ioSocket.listeners(eventName);
89+
}
90+
91+
listenersAny() {
92+
return this.ioSocket.listenersAny();
93+
}
94+
95+
listenersAnyOutgoing() {
96+
return this.ioSocket.listenersAnyOutgoing();
97+
}
98+
99+
off(eventName?: string, listener?: Function[]) {
100+
if (!eventName) {
101+
// Remove all listeners for all events
102+
return this.ioSocket.offAny();
103+
}
104+
105+
if (eventName && !listener) {
106+
// Remove all listeners for that event
107+
return this.ioSocket.off(eventName);
108+
}
109+
110+
// Removes the specified listener from the listener array for the event named
111+
return this.ioSocket.off(eventName, listener);
112+
}
113+
114+
onAny(callback: (event: string, ...args: any[]) => void) {
115+
return this.ioSocket.onAny(callback);
116+
}
117+
118+
onAnyOutgoing(callback: (event: string, ...args: any[]) => void) {
119+
return this.ioSocket.onAnyOutgoing(callback);
120+
}
121+
122+
prependAny(callback: (event: string, ...args: any[]) => void) {
123+
return this.ioSocket.prependAny(callback);
124+
}
125+
126+
prependAnyOutgoing(
127+
callback: (event: string | symbol, ...args: any[]) => void
128+
) {
129+
return this.ioSocket.prependAnyOutgoing(callback);
130+
}
131+
132+
timeout(value: number) {
133+
return this.ioSocket.timeout(value);
134+
}
135+
136+
volatile() {
137+
return this.ioSocket.volatile;
138+
}
86139
}

0 commit comments

Comments
 (0)