Skip to content

Commit

Permalink
Clean up reducer, don't set page size to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
orbiteleven committed Jun 9, 2022
1 parent 207d674 commit 5c4be09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion packages/lib/search/use-acter-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export const useActerSearch = (
dataKey: 'searchActers',
variables,
pause,
pageSize: 3,
})

useEffect(() => setActers(results.toList().toArray()), [results])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ export const getPaginatedResultsReducer = <
const hasMore = results.length > state.pagination.take
const sliceEnd = hasMore ? -1 : undefined
const nextResultsPage = results.slice(0, sliceEnd)
const newResults = nextResultsPage.reduce((map, item) => {
const newMap = map.set(item.id.toString(), item)
return newMap
}, state.results)
const newResults = nextResultsPage.reduce(
(map, item) => map.set(item.id.toString(), item),
state.results
)
return {
...state,
hasMore,
Expand Down

0 comments on commit 5c4be09

Please sign in to comment.