quick refactor, use object instead of tupple
This commit is contained in:
@@ -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()),
|
||||||
|
|||||||
Reference in New Issue
Block a user