learn-co-curriculum / putting-it-all-together-lab

Build out a full blackjack game with React and Flux!
Other
0 stars 3 forks source link

Move 'Winner' / 'Loser' to a key value in store #9

Open jjseymour opened 7 years ago

jjseymour commented 7 years ago

Right now the Winner and Loser are being determined by quite an ugly function inside app.js. It would be nicer to include a key value inside our state that holds a string value that isnull until there is a determined winner. I would advise using null for the initial value because it can be overwritten to a string and won't cause any spacing issues if you wanted to show the initial value on the page as empty.

For reference - look at the Redux Blackjack lab: https://github.com/learn-co-curriculum/redux-blackjack/blob/solution/src/reducers/gameReducer.js