Skip to content

Commit 53ed3f4

Browse files
feat: use ES6 Sets and Maps
The sids and the rooms objects are now Map<string, Set<string>>: sids => Map<SocketId, Set<Room>> rooms => Map<Room, Set<SocketId>> Breaking changes: the clients() and clientRooms() methods will now return a Set instead of an array. Also, the rooms argument in the broadcast() method will now be a Set too. Besides, the callbacks were removed from all function signatures, as every operation is synchronous. Regarding the Redis adapter, the clients() method is the only operation which will now return a promise. This change allows us to remove the Room class, which was used to have an external length attribute (instead of computing Object.keys() everytime).
1 parent ae23c7e commit 53ed3f4

File tree

7 files changed

+2961
-233
lines changed

7 files changed

+2961
-233
lines changed

.eslintrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "prettier",
3+
"parser": "babel-eslint"
4+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
.nyc_output/

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- "10"
5+
- "12"
6+
- "14"
7+
git:
8+
depth: 1
9+
notifications:
10+
irc: "irc.freenode.org#socket.io"

0 commit comments

Comments
 (0)