@jcbuisson/express-x 2.1.17 → 2.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.mjs +5 -5
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -65,13 +65,13 @@ export function expressX(config) {
|
|
|
65
65
|
|
|
66
66
|
app.log('verbose', `Client connected ${socket.id}`)
|
|
67
67
|
|
|
68
|
-
//
|
|
69
|
-
|
|
68
|
+
// emit 'connection' event for app (expressjs extends EventEmitter)
|
|
69
|
+
app.emit('connection', socket)
|
|
70
70
|
|
|
71
71
|
socketConnectListeners.forEach(listener => listener(socket))
|
|
72
72
|
|
|
73
|
-
//
|
|
74
|
-
|
|
73
|
+
// send 'connected' event to client
|
|
74
|
+
socket.emit('connected', socket.id)
|
|
75
75
|
|
|
76
76
|
socket.on('disconnecting', (reason) => {
|
|
77
77
|
app.log('verbose', `Client disconnecting ${socket.id}, ${reason}`)
|
|
@@ -207,9 +207,9 @@ export function expressX(config) {
|
|
|
207
207
|
if (service.publishFunction) {
|
|
208
208
|
// collect channel names to socket is member of
|
|
209
209
|
const channelNames = await service.publishFunction(context)
|
|
210
|
-
app.log('verbose', `publish channels ${name} ${methodName} ${channelNames}`)
|
|
211
210
|
// send event on all these channels
|
|
212
211
|
if (channelNames.length > 0) {
|
|
212
|
+
app.log('verbose', `publish channels ${name} ${methodName} ${channelNames}`)
|
|
213
213
|
let sender = io.to(channelNames[0])
|
|
214
214
|
for (let i = 1; i < channelNames.length; i++) {
|
|
215
215
|
sender = sender.to(channelNames[i])
|