Skip to content

Commit

Permalink
fix(socketio-client): Make Socket.io client event target compatible (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl authored Jul 13, 2022
1 parent 41b3761 commit 716c49a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/socketio-client/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ describe('@feathersjs/socketio-client', () => {
}
})

it('is event target compatible', async () => {
app.service('todo').addEventListener('created', (data: any) => assert.ok(data))
})

it('calls .customMethod', async () => {
const service = app.service('todos')
const result = await service.customMethod({ message: 'hi' })
Expand Down
2 changes: 2 additions & 0 deletions packages/transport-commons/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const debug = createDebug('@feathersjs/transport-commons/client')

const namespacedEmitterMethods = [
'addListener',
'addEventListener',
'emit',
'listenerCount',
'listeners',
Expand All @@ -15,6 +16,7 @@ const namespacedEmitterMethods = [
'prependListener',
'prependOnceListener',
'removeAllListeners',
'removeEventListener',
'removeListener'
]
const otherEmitterMethods = ['eventNames', 'getMaxListeners', 'setMaxListeners']
Expand Down

0 comments on commit 716c49a

Please # to comment.