update countDetail reducer
This commit is contained in:
parent
b1fce05149
commit
308f897eb7
|
@ -25,17 +25,17 @@ export const rollCounter = (rollSet: RollSet[]): CountDetails => {
|
||||||
return countDetails;
|
return countDetails;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const reduceCountDetails = (counts: CountDetails[]): CountDetails => {
|
export const reduceCountDetails = (counts: CountDetails[]): CountDetails =>
|
||||||
return counts.reduce(
|
counts.reduce(
|
||||||
(acc, cnt) => {
|
(acc, cur) => {
|
||||||
loopCountCheck();
|
loopCountCheck();
|
||||||
return {
|
return {
|
||||||
total: acc.total + cnt.total,
|
total: acc.total + cur.total,
|
||||||
successful: acc.successful + cnt.successful,
|
successful: acc.successful + cur.successful,
|
||||||
failed: acc.failed + cnt.failed,
|
failed: acc.failed + cur.failed,
|
||||||
rerolled: acc.rerolled + cnt.rerolled,
|
rerolled: acc.rerolled + cur.rerolled,
|
||||||
dropped: acc.dropped + cnt.dropped,
|
dropped: acc.dropped + cur.dropped,
|
||||||
exploded: acc.exploded + cnt.exploded,
|
exploded: acc.exploded + cur.exploded,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -47,4 +47,3 @@ export const reduceCountDetails = (counts: CountDetails[]): CountDetails => {
|
||||||
exploded: 0,
|
exploded: 0,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
Loading…
Reference in New Issue