Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/files/exercises/PhotoGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function App() {

try {
const nextPhotos = await getList(nextPage)
dispatch(actionCreators.success(nextPhotos, nextPage))
dispatch(actionCreators.success(nextPhotos))
} catch (e) {
dispatch(actionCreators.failure())
}
Expand Down
5 changes: 2 additions & 3 deletions examples/files/exercises/photos.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const types = {
export const actionCreators = {
loading: () => ({ type: types.LOADING }),
failure: () => ({ type: types.FAILURE }),
success: (photos, page) => ({
success: (photos) => ({
type: types.SUCCESS,
payload: { photos, page },
payload: { photos },
}),
}

Expand All @@ -26,7 +26,6 @@ export function reducer(state, action) {
return { ...state, loading: true, error: false }
case types.SUCCESS:
return {
...state,
loading: false,
error: false,
photos: [...state.photos, ...action.payload.photos],
Expand Down