Improved VisitsTable performance by memoizing visits lists

This commit is contained in:
Alejandro Celaya
2020-04-04 12:58:04 +02:00
parent 06b63d1af2
commit bd4255108d
4 changed files with 23 additions and 26 deletions

View File

@@ -1,4 +1,8 @@
const TEN_ROUNDING_NUMBER = 10;
const { ceil } = Math;
const formatter = new Intl.NumberFormat('en-US');
export const prettify = (number) => formatter.format(number);
export const roundTen = (number) => ceil(number / TEN_ROUNDING_NUMBER) * TEN_ROUNDING_NUMBER;