Improve performance of _getLeftPaneList (#3398)
* Improve efficiency of conversation sorting in getLeftPaneLists - Sort conversations and archivedConversations separately, without items that had falsey activeAt - Don't convert conversation titles to lowercase before comparing: collator.compare() is case-insensitive anyway. * Enable caching for format() in PhoneNumber
This commit is contained in:
parent
9376dba806
commit
6150c3dcc0
2 changed files with 18 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
import { instance, PhoneNumberFormat } from '../util/libphonenumberInstance';
|
||||
import memoizee from 'memoizee';
|
||||
|
||||
export function format(
|
||||
function _format(
|
||||
phoneNumber: string,
|
||||
options: {
|
||||
ourRegionCode: string;
|
||||
|
@ -21,6 +22,14 @@ export function format(
|
|||
}
|
||||
}
|
||||
|
||||
export const format = memoizee(_format, {
|
||||
primitive: true,
|
||||
// Convert the arguments to a unique string, required for primitive mode.
|
||||
normalizer: function(args) {
|
||||
return JSON.stringify(args);
|
||||
}
|
||||
});
|
||||
|
||||
export function parse(
|
||||
phoneNumber: string,
|
||||
options: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue