Files
inji-wallet/shared/javascript.ts
KiruthikaJeyashankar 95fb0a5ccf feat(INJI-394): show pinned vc on top in QRLogin & VCShare screen (#1048)
* refactor(INJI-503): remove unused locales

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* refactor(INJI-394): modify prop in VCItemContent

Remove passing iconType & iconName props in VCItemContent which is used to check if pinned or not to isPinned boolean prop

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* feat(INJI-349): show pinned vc on top in QRLogin screen

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* feat(INJI-349): show pinned vc on top in VCShare screen

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* refactor(INJI-349): add type annotation to groupBy method

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* refactor(INJI-449): create machine based on first selected vc in share screen

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

* refactor(INJI-394): extract method for vcs ordering by pin status

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>

---------

Signed-off-by: Kiruthika Jeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
2023-12-01 16:05:15 +05:30

15 lines
313 B
TypeScript

export function groupBy<T>(array: T[], predicate: (arg0: T) => boolean) {
const trueElements: T[] = [];
const falseElements: T[] = [];
array?.forEach(e => {
if (predicate(e)) {
trueElements.push(e);
} else {
falseElements.push(e);
}
});
return [trueElements, falseElements];
}