# Split Bill app: React + Redux

**URL:** <https://forum.freecodecamp.org/t/split-bill-app-react-redux/273510>\
**Category:** I Built This\
**Created:** [April 24, 2019, 9:33pm UTC](https://forum.freecodecamp.org/t/split-bill-app-react-redux/273510 "2019-04-24T21:33:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fellowcreature](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fellowcreature/32/114533_2.png) [@fellowcreature](https://forum.freecodecamp.org/u/fellowcreature)\
**Post date:** [April 24, 2019, 9:33pm UTC](https://forum.freecodecamp.org/t/split-bill-app-react-redux/273510/1 "2019-04-24T21:33:40Z")

</div>

Hello everyone ! I’ve just completed my first small Redux application.  
Really need feedback on this one, cause I’m not sure if all Redux logic is correct.

 ![29](https://global.discourse-cdn.com/freecodecamp/original/3X/0/5/05e01ec1c05d2b5096de75f3fe3e7cfc19baac69.png)

[Demo](https://yastrebovb.github.io/split-bill/#/)  
[Github repository](https://github.com/yastrebovb/split-bill)

I’m especially not sure if it’s okay to use middlewares in order to update dependent state across different branches of the state tree. Is using something like a root reducer a better option ?

Thanks.

---

<div class="post-metadata">

**Author:** ![jnmorse](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jnmorse/32/95357_2.png) [@jnmorse](https://forum.freecodecamp.org/u/jnmorse)\
**Post date:** [April 25, 2019, 1:38pm UTC](https://forum.freecodecamp.org/t/split-bill-app-react-redux/273510/2 "2019-04-25T13:38:21Z")

</div>

Hi, I took a look at your work and was interesting. The custom middleware was a interesting choice and while it works, I’m entirly sure it was the best approach.

One middleware I do like using in my own projects now and then that you could have used possibly is called redux-thunk. Aside from being useful in async actions it can also be used to dispatch additonal actions from a single action. Though I think since all reducers recieve the same actions, you can just have your other reducer respond to the same action type.

The fork I made sorta removed the person list you had and just retruns in result each person ows x.

My approach on the fork I made is here [https://github.com/jnmorse/split-bill/tree/my-approach](https://github.com/jnmorse/split-bill/tree/my-approach)

rather then having seperate reducers I put all the logic into a single reducer and removed the middleware.

One thing I notice is missing is the ability to add a decimal though. Right now it seems you only allow the user to enter the total in dollars only, no cents. Also might be good to add keyboard shortcuts so a user can use a keyboard to enter the amount.

Anyways hope any of this is useful to you.

---

<div class="post-metadata">

**Author:** ![fellowcreature](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/fellowcreature/32/114533_2.png) [@fellowcreature](https://forum.freecodecamp.org/u/fellowcreature)\
**Post date:** [April 25, 2019, 4:00pm UTC](https://forum.freecodecamp.org/t/split-bill-app-react-redux/273510/3 "2019-04-25T16:00:22Z")

</div>

Thank you so much for the feedback!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [February 6, 2021, 1:38pm UTC](https://forum.freecodecamp.org/t/split-bill-app-react-redux/273510/4 "2021-02-06T13:38:05Z")

</div>

Closed on February 6, 2021, 1:38pm UTC


