Skip to content

Commit

Permalink
Merge pull request #181 from atomic-state/fix-resetError
Browse files Browse the repository at this point in the history
fix(resetError):
  • Loading branch information
danybeltran authored May 12, 2024
2 parents 4287e88 + 7e0fa31 commit 18dfb9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "http-react",
"version": "3.3.8",
"version": "3.3.9",
"description": "React hooks for data fetching",
"main": "dist/index.js",
"scripts": {
Expand Down
8 changes: 5 additions & 3 deletions src/hooks/use-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1468,9 +1468,11 @@ export function useFetch<FetchDataType = any, BodyType = any>(
)

function resetError() {
setError(null)
requestsProvider.emit(requestCallId, {
error: null
hasErrors.set(resolvedKey, false)
hasErrors.set(resolvedDataKey, false)

requestsProvider.emit(resolvedKey, {
error: false
})
}

Expand Down

0 comments on commit 18dfb9c

Please sign in to comment.