quick refactor, use object instead of tupple

This commit is contained in:
Valere
2025-11-04 17:12:44 +01:00
parent 5961cb65df
commit 06734ae086

View File

@@ -221,14 +221,14 @@ export class ConnectionManager {
this.scope.behavior( this.scope.behavior(
this.connections$.pipe( this.connections$.pipe(
switchMap((connections) => { switchMap((connections) => {
// Map the connections to list of (connection, participant[])[] tuples // Map the connections to list of {connection, participants}[]
const listOfConnectionsWithPublishingParticipants = connections.map( const listOfConnectionsWithPublishingParticipants = connections.map(
(connection) => { (connection) => {
return connection.participantsWithTrack$.pipe( return connection.participantsWithTrack$.pipe(
map((participants): [Connection, LivekitParticipant[]] => [ map((participants) => ({
connection, connection,
participants, participants,
]), })),
); );
}, },
); );
@@ -237,7 +237,7 @@ export class ConnectionManager {
listOfConnectionsWithPublishingParticipants, listOfConnectionsWithPublishingParticipants,
).pipe( ).pipe(
map((lists) => map((lists) =>
lists.reduce((data, [connection, participants]) => { lists.reduce((data, { connection, participants }) => {
data.add(connection, participants); data.add(connection, participants);
return data; return data;
}, new ConnectionManagerData()), }, new ConnectionManagerData()),