How to make it right when I want to custom event for client for example:
client.emit('someEvent', data)
client.emit('someEvent', data)
then can I use framework listeners for that events ? like create someEvent.ts file so that I can use or I need to do
client.on('someEvent', handler)
client.on('someEvent', handler)
for it ?
Solution
You don't need to do anything. Just make a listener with the file name and/event name prop set to the custom name. In case of the latter you just have to use module augmentation to ensure it gets detected because the event prop is