Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional safeguards for re-renders and error types #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dylanjustice
Copy link

#67 Add additional safeguards
Covers errors that may not be strings or an instance of a ResultRecord.
Potentially prevent an unnecessary re-render by setting the state to the previous value when empty, rather than instantiating a new array.

  • Related GitHub issue(s) linked in PR description
  • Destination branch merged, built and tested with your changes
  • Code formatted and follows best practices and patterns
  • Code builds cleanly (no additional warnings or errors)
  • Manually tested
  • Automated tests are passing
  • No decreases in automated test coverage
  • Documentation updated (readme, docs, comments, etc.)
  • Localization: No hard-coded error messages in code files (minimally in string constants)

@dylanjustice dylanjustice linked an issue Jun 22, 2021 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #88 (649b7e0) into main (a8e1b5b) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #88   +/-   ##
=======================================
  Coverage   95.25%   95.25%           
=======================================
  Files          17       17           
  Lines         295      295           
  Branches       31       31           
=======================================
  Hits          281      281           
  Misses         13       13           
  Partials        1        1           
Impacted Files Coverage Δ
src/hooks/use-page-errors.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a8e1b5b...649b7e0. Read the comment docs.

Copy link
Contributor

@brandongregoryscott brandongregoryscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add a few tests to cover this behavior if you have the time 👍 But good to get this updated, either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

usePageErrors hook adds non-string objects to array
3 participants