Skip to content

Commit

Permalink
Merge pull request #4257 from mayavera/format-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
markerikson authored Jan 9, 2022
2 parents 3745f0c + ebb9d74 commit 793947f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/api/applyMiddleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ store
// I can also dispatch a thunk async action from a component
// any time its props change to load the missing data.

import React from 'react';
import React from 'react'
import { connect } from 'react-redux'

function SandwichShop(props) {
const { dispatch, forPerson } = props;
const { dispatch, forPerson } = props

useEffect(() => {
dispatch(makeASandwichWithSecretSauce(forPerson));
}, [forPerson]);
dispatch(makeASandwichWithSecretSauce(forPerson))
}, [forPerson])

return <p>{this.props.sandwiches.join('mustard')}</p>
}
Expand Down
7 changes: 5 additions & 2 deletions docs/api/bindActionCreators.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ function TodoListContainer(props) {
// We create bound versions of these functions now so we can
// pass them down to our child later.

const boundActionCreators = useMemo(() => bindActionCreators(TodoActionCreators, dispatch), [dispatch]);
const boundActionCreators = useMemo(
() => bindActionCreators(TodoActionCreators, dispatch),
[dispatch]
)
console.log(boundActionCreators)
// {
// addTodo: Function,
Expand All @@ -87,7 +90,7 @@ function TodoListContainer(props) {
// This will work:
let action = TodoActionCreators.addTodo('Use Redux')
dispatch(action)
}, []);
}, [])

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

Expand Down

0 comments on commit 793947f

Please sign in to comment.