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

feat(useDeepCompareMemo): Implement useDeepCompareMemo #979

Merged
merged 2 commits into from Oct 23, 2022

Conversation

ArttuOll
Copy link
Contributor

What new hook does?

Memoizes a value just like useMemo, but determines dependency changes by using a deep equality check (the isEqual function from react-hook/deep-equal) instead of a reference check.

Checklist

  • Have you read contribution guideline?
  • Does the code have comments in hard-to-understand areas?
  • Is there an existing issue for this PR?
  • Have the files been linted and formatted?
  • Have the docs been updated?
  • Have the tests been added to cover new hook?
  • Have you run the tests locally to confirm they pass?

Implement useDeepCompareMemo by combining useCustomCompareMemo and the isEqual function from
react-hookz/deep-equal.

Closes #871
@ArttuOll ArttuOll added the 🎂 new hook New hook added label Oct 23, 2022
@codecov
Copy link

codecov bot commented Oct 23, 2022

Codecov Report

Merging #979 (62f5143) into master (2a42e6c) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 62f5143 differs from pull request most recent head 877bb1b. Consider uploading reports for the commit 877bb1b to get more accurate results

@@            Coverage Diff            @@
##            master      #979   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           60        61    +1     
  Lines         1060      1065    +5     
  Branches       184       184           
=========================================
+ Hits          1060      1065    +5     
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)
src/useDeepCompareMemo/useDeepCompareMemo.ts 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@xobotyi xobotyi merged commit 532cc41 into master Oct 23, 2022
@xobotyi xobotyi deleted the pr/useDeepCompareMemo branch October 23, 2022 18:00
github-actions bot pushed a commit that referenced this pull request Oct 23, 2022
# [16.1.0](v16.0.1...v16.1.0) (2022-10-23)

### Features

* **useDeepCompareMemo:** Implement useDeepCompareMemo ([#979](#979)) ([532cc41](532cc41)), closes [#871](#871)
@xobotyi
Copy link
Contributor

xobotyi commented Oct 23, 2022

🎉 This PR is included in version 16.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants