Skip to content

Commit

Permalink
Merge pull request #2125 from aryaemami59/format-things
Browse files Browse the repository at this point in the history
Format all files
  • Loading branch information
EskiMojo14 committed Jan 28, 2024
2 parents e450f2b + 271b7f6 commit 35d7ae8
Show file tree
Hide file tree
Showing 29 changed files with 147 additions and 146 deletions.
4 changes: 2 additions & 2 deletions docs/api/Provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand All @@ -111,6 +111,6 @@ hydrateRoot(
document.getElementById('root'),
<Provider store={clientStore} serverState={preloadedState}>
<App />
</Provider>
</Provider>,
)
```
10 changes: 5 additions & 5 deletions docs/api/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ If your `mapDispatchToProps` function is declared as taking two parameters, it w
The second parameter is normally referred to as `ownProps` by convention.
```js
```ts
// binds on component re-rendering
<button onClick={() => this.props.toggleTodo(this.props.todoId)} />

Expand Down Expand Up @@ -203,7 +203,7 @@ The fields in the plain object you return from it will be used as the props for
The return value of `mergeProps` is referred to as `mergedProps` and the fields will be used as the props for the wrapped component.
> Note: Creating new values in mergeProps will cause re-renders. It is recommended that you memoize fields in order to avoid unnecessary re-renders.
> Note: Creating new values in mergeProps will cause re-renders. It is recommended that you memoize fields in order to avoid unnecessary re-renders.
### `options?: Object`
Expand All @@ -229,7 +229,7 @@ You may pass the context to your connected component either by passing it here a
```js
// const MyContext = React.createContext();
connect(mapStateToProps, mapDispatchToProps, null, { context: MyContext })(
MyComponent
MyComponent,
)
```
Expand Down Expand Up @@ -450,7 +450,7 @@ function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators(
{ ...todoActionCreators, ...counterActionCreators },
dispatch
dispatch,
),
}
}
Expand All @@ -472,7 +472,7 @@ function mapStateToProps(state) {
function mapDispatchToProps(dispatch) {
return bindActionCreators(
{ ...todoActionCreators, ...counterActionCreators },
dispatch
dispatch,
)
}

Expand Down
12 changes: 6 additions & 6 deletions docs/api/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand Down Expand Up @@ -174,7 +174,7 @@ import { createSelector } from 'reselect'

const selectNumCompletedTodos = createSelector(
(state) => state.todos,
(todos) => todos.filter((todo) => todo.completed).length
(todos) => todos.filter((todo) => todo.completed).length,
)

export const CompletedTodosCounter = () => {
Expand Down Expand Up @@ -203,12 +203,12 @@ const selectCompletedTodosCount = createSelector(
(state) => state.todos,
(_, completed) => completed,
(todos, completed) =>
todos.filter((todo) => todo.completed === completed).length
todos.filter((todo) => todo.completed === completed).length,
)

export const CompletedTodosCount = ({ completed }) => {
const matchingCount = useSelector((state) =>
selectCompletedTodosCount(state, completed)
selectCompletedTodosCount(state, completed),
)

return <div>{matchingCount}</div>
Expand Down Expand Up @@ -364,7 +364,7 @@ export const CounterComponent = ({ value }) => {
const dispatch = useDispatch()
const incrementCounter = useCallback(
() => dispatch({ type: 'increment-counter' }),
[dispatch]
[dispatch],
)

return (
Expand Down Expand Up @@ -573,7 +573,7 @@ export function useActions(actions, deps) {
}
return bindActionCreators(actions, dispatch)
},
deps ? [dispatch, ...deps] : [dispatch]
deps ? [dispatch, ...deps] : [dispatch],
)
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
<Provider store={store}>
<TodoApp />
</Provider>
</Provider>,
)
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ root.render(
// highlight-next-line
<Provider store={store}>
<App />
</Provider>
</Provider>,
)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const boundIncrement = bindActionCreators(increment, dispatch)
// binding an object full of action creators
const boundActionCreators = bindActionCreators(
{ increment, decrement, reset },
dispatch
dispatch,
)
// returns
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default connect(mapStateToProps)(TodoList)
You may define the function with a second argument, `ownProps`, if your component needs the data from its own props to retrieve data from the store. This argument will contain all of the props given to the wrapper component that was generated by `connect`.
```js
```ts
// Todo.js

function mapStateToProps(state, ownProps) {
Expand Down
2 changes: 1 addition & 1 deletion docs/using-react-redux/usage-with-typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const MyComponent = (props: Props) => (
// Typical usage: `connect` is called after the component is defined
export default connect<StateProps, DispatchProps, OwnProps>(
mapState,
mapDispatch
mapDispatch,
)(MyComponent)
```

Expand Down
2 changes: 1 addition & 1 deletion src/components/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ProviderProps } from './Provider'

export interface ReactReduxContextValue<
SS = any,
A extends Action<string> = UnknownAction
A extends Action<string> = UnknownAction,
> extends Pick<ProviderProps, 'stabilityCheck' | 'identityFunctionCheck'> {
store: Store<SS, A>
subscription: Subscription
Expand Down
2 changes: 1 addition & 1 deletion src/components/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ReactReduxContext } from './Context'

export interface ProviderProps<
A extends Action<string> = UnknownAction,
S = unknown
S = unknown,
> {
/**
* The single Redux store in your application.
Expand Down
Loading

0 comments on commit 35d7ae8

Please sign in to comment.