chore: Replace packages with native functions (#5140)

This commit is contained in:
David Kubeš
2022-08-03 13:38:21 +02:00
committed by GitHub
parent 262458f07d
commit a18c0a97f3
15 changed files with 68 additions and 57 deletions

View File

@@ -36,3 +36,10 @@ export const RNHelper = {
);
},
};
export const groupBy = (array, predicate) => {
return array.reduce((acc, value) => {
(acc[predicate(value)] ||= []).push(value);
return acc;
}, {});
};

View File

@@ -1,5 +1,5 @@
import { MESSAGE_TYPE } from 'widget/helpers/constants';
import groupBy from 'lodash.groupby';
import { groupBy } from 'widget/helpers/utils';
import { groupConversationBySender } from './helpers';
import { formatUnixDate } from 'shared/helpers/DateHelper';