Skip to content

Commit 35f68af

Browse files
committed
Use object assignation for getState()
As suggested by @markerikson
1 parent c4e6c32 commit 35f68af

File tree

1 file changed

+2
-2
lines changed
  • examples/shopping-cart/src/actions

1 file changed

+2
-2
lines changed

examples/shopping-cart/src/actions/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export const addToCart = productId => (dispatch, getState) => {
2121
}
2222
}
2323

24-
export const checkout = (products) => (dispatch, getState) => {
25-
const cart = getState().cart
24+
export const checkout = products => (dispatch, getState) => {
25+
const { cart } = getState()
2626

2727
dispatch({
2828
type: types.CHECKOUT_REQUEST

0 commit comments

Comments
 (0)