Skip to content

Commit

Permalink
Avoid unnecessarily clearing the resourcesWithError set in clearResou…
Browse files Browse the repository at this point in the history
…rceErrors

It is not necessary to clear the resourcesWithError set in
clearResourceErrors after having iterated through all the resources with
error and called Resource#clearError() because Resource#clearError()
already removes the resource from the set, so after the iteration
completes, the set is already empty.
  • Loading branch information
kyarik committed Nov 29, 2020
1 parent 535bd35 commit d110a6f
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/lazyResource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,4 @@ export const lazyResource = <T>(
*/
export const clearResourceErrors = () => {
resourcesWithError.forEach(resource => resource.clearError());

resourcesWithError.clear();
};

0 comments on commit d110a6f

Please sign in to comment.