Skip to content

Commit 43f0216

Browse files
committed
arguments flipped & reduced.
1 parent 6004ee5 commit 43f0216

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

server/modules/app.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ const io = new Server(server, {
1717

1818
io.on('connection', (socket) => {
1919
socket.join('default');
20-
require("./connection")(io, socket);
21-
require("./message")(io, socket);
22-
require("./user")(io, socket);
23-
require("./typing")(io, socket);
20+
require("./connection")(socket, io);
21+
require("./message")(socket, io);
22+
require("./user")(socket, io);
23+
require("./typing")(socket, io);
2424
});
2525

2626
module.exports = io;

server/modules/connection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const constants = require("./constants");
22

3-
module.exports = (io, socket) => {
3+
module.exports = (socket) => {
44

55
const onConnection = () => {
66
// Store the remote connection in the socket session for the client

server/modules/message.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const constants = require("./constants");
22

3-
module.exports = (io, socket) => {
3+
module.exports = (socket) => {
44

55
// When the client emits 'direct message'
66
const onDirectMessage = (anotherSocketId, message) => {

server/modules/typing.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const constants = require("./constants");
22

3-
module.exports = (io, socket) => {
3+
module.exports = (socket) => {
44

55
// When the client emits 'typing start'.
66
const onTypingStart = () => {

server/modules/user.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const constants = require("./constants");
22

3-
module.exports = (io, socket) => {
3+
module.exports = (socket, io) => {
44

55
const getSockets = () => {
66
let data = [];

0 commit comments

Comments
 (0)