Skip to content

Commit

Permalink
feat: reset hook state when config changes with outstanding manual fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
vmlopezr committed Feb 14, 2021
1 parent 2325e07 commit 8b2f166
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export function makeUseAxios(configureOptions) {
).catch(() => {})
}

return cancelOutstandingRequest
return () => { cancelOutstandingRequest(options.manual)}
}, [config, options, withCancelToken, cancelOutstandingRequest])

const refetch = React.useCallback(
Expand Down

0 comments on commit 8b2f166

Please sign in to comment.