Skip to content

Commit ba62b06

Browse files
committed
Prettier reformatting
1 parent 642067b commit ba62b06

File tree

6 files changed

+15
-33
lines changed

6 files changed

+15
-33
lines changed

docs/api/createEntityAdapter.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,10 @@ console.log(store.getState().books)
365365
// {ids: ["a"], entities: {a: {id: "a", title: "First (altered)"}}, loading: 'pending' }
366366

367367
store.dispatch(
368-
booksReceived([{ id: 'b', title: 'Book 3' }, { id: 'c', title: 'Book 2' }])
368+
booksReceived([
369+
{ id: 'b', title: 'Book 3' },
370+
{ id: 'c', title: 'Book 2' }
371+
])
369372
)
370373

371374
console.log(booksSelectors.selectIds(store.getState()))

docs/tutorials/intermediate-tutorial.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,7 @@ const AddTodo = ({ addTodo }) => {
430430
)
431431
}
432432

433-
export default connect(
434-
null,
435-
mapDispatch
436-
)(AddTodo)
433+
export default connect(null, mapDispatch)(AddTodo)
437434
```
438435
439436
We start by importing the correct `addTodo` action creator from our todos slice.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
"build-ci": "tsdx build --format cjs,esm,umd --name redux-toolkit && api-extractor run",
4545
"build": "tsdx build --format cjs,esm,umd --name redux-toolkit && api-extractor run --local",
4646
"dev": "tsdx watch --format cjs,esm,umd",
47-
"format": "prettier --write \"src/*.ts\" \"**/*.md\"",
48-
"format:check": "prettier --list-different \"src/*.ts\" \"docs/*/**.md\"",
47+
"format": "prettier --write \"src/**/*.ts\" \"**/*.md\"",
48+
"format:check": "prettier --list-different \"src/**/*.ts\" \"docs/*/**.md\"",
4949
"lint": "tsdx lint src",
5050
"prepare": "npm run lint && npm run format:check && npm test && npm run build-ci",
5151
"test": "tsdx test"

src/entities/state_selectors.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ describe('Entity State Selectors', () => {
9696
const singleEntity: Selector<
9797
EntityState<BookModel>,
9898
BookModel | undefined
99-
> = createSelector(
100-
selectors.selectEntities,
101-
entities => entities[0]
102-
)
99+
> = createSelector(selectors.selectEntities, entities => entities[0])
103100
})
104101

105102
it('should create a selector for selecting the list of models', () => {

src/entities/state_selectors.ts

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ export function createSelectorsFactory<T>() {
1818
ids.map((id: any) => (entities as any)[id])
1919
)
2020

21-
const selectTotal = createSelector(
22-
selectIds,
23-
ids => ids.length
24-
)
21+
const selectTotal = createSelector(selectIds, ids => ids.length)
2522

2623
if (!selectState) {
2724
return {
@@ -33,22 +30,10 @@ export function createSelectorsFactory<T>() {
3330
}
3431

3532
return {
36-
selectIds: createSelector(
37-
selectState,
38-
selectIds
39-
),
40-
selectEntities: createSelector(
41-
selectState,
42-
selectEntities
43-
),
44-
selectAll: createSelector(
45-
selectState,
46-
selectAll
47-
),
48-
selectTotal: createSelector(
49-
selectState,
50-
selectTotal
51-
)
33+
selectIds: createSelector(selectState, selectIds),
34+
selectEntities: createSelector(selectState, selectEntities),
35+
selectAll: createSelector(selectState, selectAll),
36+
selectTotal: createSelector(selectState, selectTotal)
5237
}
5338
}
5439

src/tsHelpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ export type DispatchForMiddlewares<M> = M extends ReadonlyArray<any>
8585
* Convert a Union type `(A|B)` to and intersecion type `(A&B)`
8686
*/
8787
type UnionToIntersection<U> = (U extends any
88-
? (k: U) => void
89-
: never) extends ((k: infer I) => void)
88+
? (k: U) => void
89+
: never) extends (k: infer I) => void
9090
? I
9191
: never
9292

0 commit comments

Comments
 (0)