Reduce redundant calculations of display name map (#3062)
* Use share() on fromEvent() so that we multiplex subscribers onto the event emitter * . * . * Comment * Comment --------- Co-authored-by: Hugh Nimmo-Smith <hughns@element.io>
This commit is contained in:
@@ -496,6 +496,10 @@ export class CallViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
return displaynameMap;
|
return displaynameMap;
|
||||||
}),
|
}),
|
||||||
|
// It turns out that doing the disambiguation above is rather expensive on Safari (10x slower
|
||||||
|
// than on Chrome/Firefox). This means it is important that we share() the result so that we
|
||||||
|
// don't do this work more times than we need to. This is achieve through the state() operator:
|
||||||
|
this.scope.state(),
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user