Skip to content

Commit 67f7b96

Browse files
msutkowskiphryneas
authored andcommitted
Formatting
1 parent bdb95e7 commit 67f7b96

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/api/createAsyncThunk.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ import { userAPI } from './userAPI'
391391
const updateUser = createAsyncThunk(
392392
'users/update',
393393
async (userData, { rejectWithValue }) => {
394-
const { id, ...fields } = userData;
394+
const { id, ...fields } = userData
395395
try {
396396
const response = await userAPI.updateById(id, fields)
397397
return response.data.user
@@ -531,11 +531,16 @@ const usersSlice = createSlice({
531531
})
532532

533533
const UsersComponent = () => {
534-
const { users, loading, error } = useSelector((state: RootState) => state.users)
534+
const { users, loading, error } = useSelector(
535+
(state: RootState) => state.users
536+
)
535537
const dispatch: AppDispatch = useDispatch()
536538

537539
// This is an example of an onSubmit handler using Formik meant to demonstrate accessing the payload of the rejected action
538-
const handleUpdateUser = async (values: FormValues, formikHelpers: FormikHelpers<FormValues>) => {
540+
const handleUpdateUser = async (
541+
values: FormValues,
542+
formikHelpers: FormikHelpers<FormValues>
543+
) => {
539544
const resultAction = await dispatch(updateUser(values))
540545
if (updateUser.fulfilled.match(resultAction)) {
541546
// user will have a type signature of User as we passed that as the Returned parameter in createAsyncThunk

0 commit comments

Comments
 (0)