WIP optimize connect with redux state in preferences pages.

This commit is contained in:
Ahmed Bouhuolia
2020-05-10 23:22:36 +02:00
parent a0653674ff
commit 464c36d532
32 changed files with 403 additions and 327 deletions

View File

@@ -1,3 +1,9 @@
export const getCurrencyById = (items, id) => {
return items[id] || null;
// @flow
export const getCurrencyById = (currencies: Object, id: Integer) => {
return Object.values(currencies).find(c => c.id == id) || null;
};
export const getCurrencyByCode = (currencies: Object, currencyCode: String) => {
return currencies[currencyCode] || null;
};