Skip to content

Commit 7dafff5

Browse files
authored
Merge branch 'reduxjs:master' into upgrade-rollup-plugin-typescript
2 parents e305bf0 + 793947f commit 7dafff5

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/api/applyMiddleware.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ store
173173
// I can also dispatch a thunk async action from a component
174174
// any time its props change to load the missing data.
175175

176-
import React from 'react';
176+
import React from 'react'
177177
import { connect } from 'react-redux'
178178

179179
function SandwichShop(props) {
180-
const { dispatch, forPerson } = props;
180+
const { dispatch, forPerson } = props
181181

182182
useEffect(() => {
183-
dispatch(makeASandwichWithSecretSauce(forPerson));
184-
}, [forPerson]);
183+
dispatch(makeASandwichWithSecretSauce(forPerson))
184+
}, [forPerson])
185185

186186
return <p>{this.props.sandwiches.join('mustard')}</p>
187187
}

docs/api/bindActionCreators.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ function TodoListContainer(props) {
7070
// We create bound versions of these functions now so we can
7171
// pass them down to our child later.
7272

73-
const boundActionCreators = useMemo(() => bindActionCreators(TodoActionCreators, dispatch), [dispatch]);
73+
const boundActionCreators = useMemo(
74+
() => bindActionCreators(TodoActionCreators, dispatch),
75+
[dispatch]
76+
)
7477
console.log(boundActionCreators)
7578
// {
7679
// addTodo: Function,
@@ -87,7 +90,7 @@ function TodoListContainer(props) {
8790
// This will work:
8891
let action = TodoActionCreators.addTodo('Use Redux')
8992
dispatch(action)
90-
}, []);
93+
}, [])
9194

9295
return <TodoList todos={todos} {...this.boundActionCreators} />
9396

0 commit comments

Comments
 (0)