Skip to content

Commit

Permalink
fix: bad condition inside handleRequest (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianMaliszewski authored May 10, 2021
1 parent 4d70fd4 commit 11cbd72
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions packages/use-dataloader/src/__tests__/useDataLoader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ describe('useDataLoader', () => {
rerender()
expect(result.current.isLoading).toBe(true)
expect(result.current.data).toBe(undefined)
propsToPass.key = 'new-new-test'
rerender()
expect(result.current.data).toBe(undefined)
expect(result.current.isLoading).toBe(true)
await waitForNextUpdate()
expect(result.current.data).toBe(true)
expect(result.current.isSuccess).toBe(true)
Expand Down
4 changes: 0 additions & 4 deletions packages/use-dataloader/src/useDataLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ const useDataLoader = (
dispatch(Actions.createOnLoading())
const result = await methodRef.current?.()

if (keyRef.current && cacheKey && cacheKey !== keyRef.current) {
return
}

if (keepPreviousData) {
previousDataRef.current = getCachedData(cacheKey)
}
Expand Down

0 comments on commit 11cbd72

Please sign in to comment.