Generates a random list of requests for participants, ensuring unique icons per participant and excluding the host and co-host from the request list.
Configuration options for generating requests.
Array of participant objects.
Name of the host to be excluded.
Optional name of the co-host to be excluded.
Number of requests to generate per participant.
Array of requests, each uniquely associated with a participant.
const requestService = new GenerateRandomRequestList();const participants = [ { id: '1', name: 'Alice' }, { id: '2', name: 'Bob' }, { id: '3', name: 'Charlie' }];const options = { participants, hostName: 'Alice', coHostName: 'Bob', numberOfRequests: 2};const requests = requestService.generateRandomRequestList(options);console.log(requests);// Output:// [// { id: '3', name: 'charlie', icon: 'fa-microphone', username: 'charlie' },// { id: '3', name: 'charlie', icon: 'fa-desktop', username: 'charlie' }// ] Copy
const requestService = new GenerateRandomRequestList();const participants = [ { id: '1', name: 'Alice' }, { id: '2', name: 'Bob' }, { id: '3', name: 'Charlie' }];const options = { participants, hostName: 'Alice', coHostName: 'Bob', numberOfRequests: 2};const requests = requestService.generateRandomRequestList(options);console.log(requests);// Output:// [// { id: '3', name: 'charlie', icon: 'fa-microphone', username: 'charlie' },// { id: '3', name: 'charlie', icon: 'fa-desktop', username: 'charlie' }// ]
Generates a list of random requests for participants, excluding the host and co-host.
The options for generating the request list.
The generated list of requests.
Generates a random list of requests for participants, ensuring unique icons per participant and excluding the host and co-host from the request list.
Param: options
Configuration options for generating requests.
Param: options.participants
Array of participant objects.
Param: options.hostName
Name of the host to be excluded.
Param: options.coHostName
Optional name of the co-host to be excluded.
Param: options.numberOfRequests
Number of requests to generate per participant.
Returns
Array of requests, each uniquely associated with a participant.
Example