Skip to content

Commit

Permalink
Format the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Mar 20, 2024
1 parent 3085048 commit 969edb7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/api/combineReducers.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default combineReducers({
#### `App.js`

```js
import { configureStore } from '@reduxjs/toolkit'
import { configureStore } from '@reduxjs/toolkit'
import reducer from './reducers/index'

const store = configureStore({
Expand Down
2 changes: 0 additions & 2 deletions docs/introduction/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ Here are some suggestions on when it makes sense to use Redux:
>
> - **[Redux FAQ: When should I use Redux?](../faq/General.md#when-should-i-use-redux)**
> - **[You Might Not Need Redux](https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367)**
>
> - **[The Tao of Redux, Part 1 - Implementation and Intent](https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-1/)**
>
> - **[The Tao of Redux, Part 2 - Practice and Philosophy](https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-tao-of-redux-part-2/)**
> - **[Redux FAQ](../FAQ.md)**
4 changes: 2 additions & 2 deletions docs/usage/WritingTests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ interface ExtendedRenderOptions extends Omit<RenderOptions, 'queries'> {

export function renderWithProviders(
ui: React.ReactElement,
extendedRenderOptions: ExtendedRenderOptions = {},
extendedRenderOptions: ExtendedRenderOptions = {}
) {
const {
preloadedState = {},
Expand All @@ -367,7 +367,7 @@ export function renderWithProviders(
// Return an object with the store and all of RTL's query functions
return {
store,
...render(ui, { wrapper: Wrapper, ...renderOptions }),
...render(ui, { wrapper: Wrapper, ...renderOptions })
}
}
```
Expand Down
23 changes: 13 additions & 10 deletions docs/usage/migrating-to-modern-redux.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ This example shows several possible common tasks when setting up a Redux store:
None of these are _required_, but they do show up frequently in real-world codebases.

```js title="Custom Store Setup: src/app/store.js"
import { configureStore, combineReducers} from '@reduxjs/toolkit'
import { configureStore, combineReducers } from '@reduxjs/toolkit'
import {
persistStore,
persistReducer,
Expand All @@ -139,7 +139,7 @@ import {
PAUSE,
PERSIST,
PURGE,
REGISTER,
REGISTER
} from 'redux-persist'
import storage from 'redux-persist/lib/storage'
import { PersistGate } from 'redux-persist/integration/react'
Expand All @@ -163,7 +163,7 @@ const rootReducer = combineReducers({
const persistConfig = {
key: 'root',
version: 1,
storage,
storage
}

const persistedReducer = persistReducer(persistConfig, rootReducer)
Expand All @@ -175,12 +175,12 @@ const store = configureStore({
const middleware = getDefaultMiddleware({
// Pass in a custom `extra` argument to the thunk middleware
thunk: {
extraArgument: {serviceLayer}
extraArgument: { serviceLayer }
},
// Customize the built-in serializability dev check
serializableCheck: {
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER],
},
ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER]
}
}).concat(customMiddleware, api.middleware)

// Conditionally add another middleware in dev
Expand All @@ -191,9 +191,12 @@ const store = configureStore({
return middleware
},
// Turn off devtools in prod, or pass options in dev
devTools: process.env.NODE_ENV === 'production' ? false : {
stateSanitizer: stateSanitizerForDevtools
}
devTools:
process.env.NODE_ENV === 'production'
? false
: {
stateSanitizer: stateSanitizerForDevtools
}
})
```

Expand Down Expand Up @@ -817,7 +820,7 @@ export const store = createStore(rootReducer)
export type RootAction = TodoActions | CounterActions
// ❌ Common pattern: manually defining the root state type with each field
export interface RootState {
todos: TodosState;
todos: TodosState
counter: CounterState
}
Expand Down

0 comments on commit 969edb7

Please sign in to comment.