Skip to content

Commit d36a3a1

Browse files
authored
Merge pull request #4135 from aryaemami59/format-all-files
Format all files
2 parents 527e0b6 + b0ce4df commit d36a3a1

File tree

331 files changed

+3220
-3224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

331 files changed

+3220
-3224
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,17 @@ jobs:
149149
fail-fast: false
150150
matrix:
151151
node: ['18.x']
152-
example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm', 'react-native', 'expo']
152+
example:
153+
[
154+
'cra4',
155+
'cra5',
156+
'next',
157+
'vite',
158+
'node-standard',
159+
'node-esm',
160+
'react-native',
161+
'expo',
162+
]
153163
defaults:
154164
run:
155165
working-directory: ./examples/publish-ci/${{ matrix.example }}

.prettierrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@
33
"singleQuote": true,
44
"endOfLine": "auto"
55
}
6-

.yarn/releases/yarn-3.2.4.cjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/api/actionCreatorMiddleware.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ import reducer from './reducer'
5353

5454
// Augment middleware to consider all functions with a static type property to be action creators
5555
const isActionCreator = (
56-
action: unknown
56+
action: unknown,
5757
): action is Function & { type: unknown } =>
5858
typeof action === 'function' && 'type' in action
5959

docs/api/combineSlices.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ declare module '.' {
235235

236236
const withInjected = rootReducer.inject(
237237
{ reducerPath: 'removable', reducer: removableReducer },
238-
{ overrideExisting: true }
238+
{ overrideExisting: true },
239239
)
240240

241241
const emptyReducer = () => null
242242

243243
const removeReducer = () =>
244244
rootReducer.inject(
245245
{ reducerPath: 'removable', reducer: emptyReducer },
246-
{ overrideExisting: true }
246+
{ overrideExisting: true },
247247
)
248248
```
249249

@@ -273,14 +273,14 @@ const withCounter = rootReducer.inject(counterSlice)
273273
const selectCounterValue = (rootState: RootState) => rootState.counter?.value // number | undefined
274274

275275
const wrappedSelectCounterValue = withCounter.selector(
276-
(rootState) => rootState.counter.value // number
276+
(rootState) => rootState.counter.value, // number
277277
)
278278

279279
console.log(
280280
selectCounterValue({}), // undefined
281281
selectCounterValue({ counter: { value: 2 } }), // 2
282282
wrappedSelectCounterValue({}), // 0
283-
wrappedSelectCounterValue({ counter: { value: 2 } }) // 2
283+
wrappedSelectCounterValue({ counter: { value: 2 } }), // 2
284284
)
285285
```
286286

@@ -303,7 +303,7 @@ interface RootState {
303303

304304
const selectCounterValue = withCounter.selector(
305305
(combinedState) => combinedState.counter.value,
306-
(rootState: RootState) => rootState.innerCombined
306+
(rootState: RootState) => rootState.innerCombined,
307307
)
308308

309309
console.log(
@@ -316,7 +316,7 @@ console.log(
316316
value: 2,
317317
},
318318
},
319-
}) // 2
319+
}), // 2
320320
)
321321
```
322322

@@ -365,6 +365,6 @@ If the slice state is undefined in the store state passed, the selector will ins
365365
console.log(
366366
injectedCounterSlice.selectors.selectValue({}), // 0
367367
injectedCounterSlice.selectors.selectValue({ counter: { value: 2 } }), // 2
368-
aCounterSlice.selectors.selectValue({ aCounter: { value: 2 } }) // 2
368+
aCounterSlice.selectors.selectValue({ aCounter: { value: 2 } }), // 2
369369
)
370370
```

docs/api/createAction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,6 @@ export const epic = (actions$: Observable<Action>) =>
148148
map((action) => {
149149
// action.payload can be safely used as number here (and will also be correctly inferred by TypeScript)
150150
// ...
151-
})
151+
}),
152152
)
153153
```

docs/api/createAsyncThunk.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const fetchUserById = createAsyncThunk(
3535
async (userId: number, thunkAPI) => {
3636
const response = await userAPI.fetchById(userId)
3737
return response.data
38-
}
38+
},
3939
)
4040

4141
interface UsersState {
@@ -190,23 +190,23 @@ interface RejectedWithValueAction<ThunkArg, RejectedValue> {
190190

191191
type Pending = <ThunkArg>(
192192
requestId: string,
193-
arg: ThunkArg
193+
arg: ThunkArg,
194194
) => PendingAction<ThunkArg>
195195

196196
type Fulfilled = <ThunkArg, PromiseResult>(
197197
payload: PromiseResult,
198198
requestId: string,
199-
arg: ThunkArg
199+
arg: ThunkArg,
200200
) => FulfilledAction<ThunkArg, PromiseResult>
201201

202202
type Rejected = <ThunkArg>(
203203
requestId: string,
204-
arg: ThunkArg
204+
arg: ThunkArg,
205205
) => RejectedAction<ThunkArg>
206206

207207
type RejectedWithValue = <ThunkArg, RejectedValue>(
208208
requestId: string,
209-
arg: ThunkArg
209+
arg: ThunkArg,
210210
) => RejectedWithValueAction<ThunkArg, RejectedValue>
211211
```
212212
@@ -365,7 +365,7 @@ const updateUser = createAsyncThunk(
365365
// by explicitly returning it using the `rejectWithValue()` utility
366366
return rejectWithValue(err.response.data)
367367
}
368-
}
368+
},
369369
)
370370
```
371371

@@ -391,7 +391,7 @@ const fetchUserById = createAsyncThunk(
391391
return false
392392
}
393393
},
394-
}
394+
},
395395
)
396396
```
397397

@@ -419,7 +419,7 @@ export const fetchUserById = createAsyncThunk(
419419
'fetchUserById',
420420
(userId: string) => {
421421
/* ... */
422-
}
422+
},
423423
)
424424

425425
// file: MyComponent.ts
@@ -456,7 +456,7 @@ const fetchUserById = createAsyncThunk(
456456
signal: thunkAPI.signal,
457457
})
458458
return await response.json()
459-
}
459+
},
460460
)
461461
```
462462

@@ -486,7 +486,7 @@ const readStream = createAsyncThunk(
486486
done = read.done
487487
}
488488
return result
489-
}
489+
},
490490
)
491491
```
492492

@@ -510,7 +510,7 @@ const fetchUserById = createAsyncThunk(
510510
cancelToken: source.token,
511511
})
512512
return response.data
513-
}
513+
},
514514
)
515515
```
516516

@@ -749,7 +749,7 @@ const UsersComponent = (props: { id: string }) => {
749749
// This is an example of an onSubmit handler using Formik meant to demonstrate accessing the payload of the rejected action
750750
const handleUpdateUser = async (
751751
values: FormValues,
752-
formikHelpers: FormikHelpers<FormValues>
752+
formikHelpers: FormikHelpers<FormValues>,
753753
) => {
754754
const resultAction = await dispatch(updateUser({ id: props.id, ...values }))
755755
if (updateUser.fulfilled.match(resultAction)) {

docs/api/createDynamicMiddleware.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The "dynamic middleware instance" returned from `createDynamicMiddleware` is an
8080
```ts no-transpile
8181
export type DynamicMiddlewareInstance<
8282
State = unknown,
83-
Dispatch extends ReduxDispatch<UnknownAction> = ReduxDispatch<UnknownAction>
83+
Dispatch extends ReduxDispatch<UnknownAction> = ReduxDispatch<UnknownAction>,
8484
> = {
8585
middleware: DynamicMiddleware<State, Dispatch>
8686
addMiddleware: AddMiddleware<State, Dispatch>
@@ -116,7 +116,7 @@ Accepts a set of middleware, and creates an action. When dispatched, it injects
116116
117117
```ts no-transpile
118118
const listenerDispatch = store.dispatch(
119-
withMiddleware(listenerMiddleware.middleware)
119+
withMiddleware(listenerMiddleware.middleware),
120120
)
121121

122122
const unsubscribe = listenerDispatch(addListener({ type, effect }))
@@ -131,7 +131,7 @@ _These depend on having `react-redux` installed._
131131
```ts no-transpile
132132
interface ReactDynamicMiddlewareInstance<
133133
State = any,
134-
Dispatch extends ReduxDispatch<UnknownAction> = ReduxDispatch<UnknownAction>
134+
Dispatch extends ReduxDispatch<UnknownAction> = ReduxDispatch<UnknownAction>,
135135
> extends DynamicMiddlewareInstance<State, Dispatch> {
136136
createDispatchWithMiddlewareHook: CreateDispatchWithMiddlewareHook<
137137
State,
@@ -140,7 +140,7 @@ interface ReactDynamicMiddlewareInstance<
140140
createDispatchWithMiddlewareHookFactory: (
141141
context?: Context<
142142
ReactReduxContextValue<State, ActionFromDispatch<Dispatch>>
143-
>
143+
>,
144144
) => CreateDispatchWithMiddlewareHook<State, Dispatch>
145145
}
146146
```
@@ -151,7 +151,7 @@ Accepts a set of middleware, and returns a [`useDispatch`](https://react-redux.j
151151

152152
```ts no-transpile
153153
const useListenerDispatch = createDispatchWithMiddlewareHook(
154-
listenerInstance.middleware
154+
listenerInstance.middleware,
155155
)
156156

157157
const Component = () => {

docs/api/createEntityAdapter.mdx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ console.log(store.getState().books)
8282

8383
// Can create a set of memoized selectors based on the location of this entity state
8484
const booksSelectors = booksAdapter.getSelectors<RootState>(
85-
(state) => state.books
85+
(state) => state.books,
8686
)
8787

8888
// And then use the selectors to retrieve values
@@ -148,21 +148,21 @@ export interface EntityStateAdapter<T> {
148148
removeMany<S extends EntityState<T>>(state: S, keys: EntityId[]): S
149149
removeMany<S extends EntityState<T>>(
150150
state: S,
151-
keys: PayloadAction<EntityId[]>
151+
keys: PayloadAction<EntityId[]>,
152152
): S
153153

154154
removeAll<S extends EntityState<T>>(state: S): S
155155

156156
updateOne<S extends EntityState<T>>(state: S, update: Update<T>): S
157157
updateOne<S extends EntityState<T>>(
158158
state: S,
159-
update: PayloadAction<Update<T>>
159+
update: PayloadAction<Update<T>>,
160160
): S
161161

162162
updateMany<S extends EntityState<T>>(state: S, updates: Update<T>[]): S
163163
updateMany<S extends EntityState<T>>(
164164
state: S,
165-
updates: PayloadAction<Update<T>[]>
165+
updates: PayloadAction<Update<T>[]>,
166166
): S
167167

168168
upsertOne<S extends EntityState<T>>(state: S, entity: T): S
@@ -171,7 +171,7 @@ export interface EntityStateAdapter<T> {
171171
upsertMany<S extends EntityState<T>>(state: S, entities: T[]): S
172172
upsertMany<S extends EntityState<T>>(
173173
state: S,
174-
entities: PayloadAction<T[]>
174+
entities: PayloadAction<T[]>,
175175
): S
176176
}
177177

@@ -190,7 +190,7 @@ export interface EntityAdapter<T> extends EntityStateAdapter<T> {
190190
getInitialState<S extends object>(state: S): EntityState<T> & S
191191
getSelectors(): EntitySelectors<T, EntityState<T>>
192192
getSelectors<V>(
193-
selectState: (state: V) => EntityState<T>
193+
selectState: (state: V) => EntityState<T>,
194194
): EntitySelectors<T, V>
195195
}
196196
```
@@ -225,7 +225,8 @@ All three options will insert _new_ entities into the list. However they differ
225225
Each method has a signature that looks like:
226226

227227
```ts no-transpile
228-
(state: EntityState<T>, argument: TypeOrPayloadAction<Argument<T>>) => EntityState<T>
228+
;(state: EntityState<T>, argument: TypeOrPayloadAction<Argument<T>>) =>
229+
EntityState<T>
229230
```
230231

231232
In other words, they accept a state that looks like `{ids: [], entities: {}}`, and calculate and return a new state.
@@ -407,7 +408,7 @@ store.dispatch(
407408
booksReceived([
408409
{ id: 'b', title: 'Book 3' },
409410
{ id: 'c', title: 'Book 2' },
410-
])
411+
]),
411412
)
412413

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

0 commit comments

Comments
 (0)