socketio / socketio/socket.io

Add an onMany method to attach a callback to multiple socket events.

Open
#5,121 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

package:socket.io-client
Dominant language
TypeScript
Stars
63.2k
Forks
10.3k
Avg merge
11d 20h
Merged PRs (30d)
2

Description

When emitting multiple events of a similar functionality from the server, One has to apply a 'socket.on' listener to each one of them. Rather than what will be feasible is to have an onMany method which will take in an array of all the expected events and then fire the callback if any of the event is being emitted from the server.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing socket.on entry point and how server-side event listeners are exposed. Define how an array of event names should invoke one callback, including the emitted arguments, and confirm the behavior with the repository's relevant socket event tests. Done means the new onMany API handles any listed event consistently without changing socket.on behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
api, backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.