chore: Replace packages with native functions (#5140)
This commit is contained in:
parent
262458f07d
commit
a18c0a97f3
15 changed files with 68 additions and 57 deletions
|
@ -36,3 +36,10 @@ export const RNHelper = {
|
|||
);
|
||||
},
|
||||
};
|
||||
|
||||
export const groupBy = (array, predicate) => {
|
||||
return array.reduce((acc, value) => {
|
||||
(acc[predicate(value)] ||= []).push(value);
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue