add selectors for total supports and claim supports #178
1 changed files with 15 additions and 0 deletions
|
@ -90,6 +90,21 @@ export const selectSupportsByOutpoint = createSelector(
|
||||||
state => state.supports || {}
|
state => state.supports || {}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const selectTotalSupports = createSelector(
|
||||||
|
selectSupportsByOutpoint,
|
||||||
|
byOutpoint => {
|
||||||
|
let total = parseFloat("0.0");
|
||||||
|
//let total = 0.0;
|
||||||
|
|
||||||
|
Object.values(byOutpoint).forEach(support => {
|
||||||
|
const { amount } = support;
|
||||||
|
total = amount ? total + parseFloat(amount) : total;
|
||||||
|
});
|
||||||
|
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
export const selectTransactionItems = createSelector(
|
export const selectTransactionItems = createSelector(
|
||||||
selectTransactionsById,
|
selectTransactionsById,
|
||||||
byId => {
|
byId => {
|
||||||
|
|
Loading…
Reference in a new issue