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: new hook usePreviousDistinct #585

Merged
merged 8 commits into from
Jan 17, 2022

Conversation

kylemh
Copy link
Contributor

@kylemh kylemh commented Jan 16, 2022

What new hook does?

Outlined in #33 and here.

While I haven't needed this hook myself, I began understanding the value and differences usePrevious and usePreviousDistinct offer. I feel like people who reach for usePrevious may wish to know that usePreviousDistinct exists. I may not have done well on that front, but wanted to give it a go.

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?

@codecov
Copy link

codecov bot commented Jan 16, 2022

Codecov Report

Merging #585 (f1476ca) into master (403b259) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #585   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           45        46    +1     
  Lines          798       812   +14     
  Branches       150       152    +2     
=========================================
+ Hits           798       812   +14     
Impacted Files Coverage Δ
src/index.ts 100.00% <100.00%> (ø)
src/usePreviousDistinct/usePreviousDistinct.ts 100.00% <100.00%> (ø)
src/util/const.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 403b259...f1476ca. Read the comment docs.

@kylemh kylemh changed the title feat: new hook useDeepCompareEffect feat: new hook usePreviousDistinct Jan 16, 2022
@xobotyi xobotyi merged commit 1bf69d6 into react-hookz:master Jan 17, 2022
@kylemh kylemh deleted the usePreviousDistinct branch January 17, 2022 11:11
github-actions bot pushed a commit that referenced this pull request Jan 17, 2022
# [12.3.0](v12.2.0...v12.3.0) (2022-01-17)

### Features

* new hook `usePreviousDistinct` ([#585](#585)) ([1bf69d6](1bf69d6)), closes [#33](#33)
@xobotyi
Copy link
Contributor

xobotyi commented Jan 17, 2022

🎉 This PR is included in version 12.3.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.

2 participants