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 hooks useThrottledEffect and useThrottledState #137

Merged
merged 2 commits into from
Jun 17, 2021

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Jun 17, 2021

What new hook does?

useThrottledEffect - Like useEffect, but passed function is throttled.
useThrottledState - Like useSafeState but its state setter is throttled.

Checklist

  • Have you read contribution guideline?
  • Does the code have comments in hard-to-understand areas?
  • Is there an existing issue for this PR?
    • link issue here
  • 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?

@xobotyi xobotyi added the 🎂 new hook New hook added label Jun 17, 2021
@xobotyi xobotyi requested a review from JoeDuncko June 17, 2021 12:12
@xobotyi xobotyi force-pushed the useThrottleEffect branch from ba7f848 to 3a65a38 Compare June 17, 2021 12:13
@codecov
Copy link

codecov bot commented Jun 17, 2021

Codecov Report

Merging #137 (761e603) into master (b4f3833) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #137   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           34        36    +2     
  Lines          555       567   +12     
  Branches       102       104    +2     
=========================================
+ Hits           555       567   +12     
Impacted Files Coverage Δ
src/useThrottledCallback/useThrottledCallback.ts 100.00% <ø> (ø)
src/index.ts 100.00% <100.00%> (ø)
src/useThrottledEffect/useThrottledEffect.ts 100.00% <100.00%> (ø)
src/useThrottledState/useThrottledState.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 b4f3833...761e603. Read the comment docs.

@xobotyi xobotyi force-pushed the useThrottleEffect branch from 3a65a38 to ec49899 Compare June 17, 2021 12:15
Copy link
Contributor

@JoeDuncko JoeDuncko left a comment

Choose a reason for hiding this comment

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

Fixed some typos, but now LGTM

@JoeDuncko JoeDuncko merged commit 1cc6677 into master Jun 17, 2021
github-actions bot pushed a commit that referenced this pull request Jun 17, 2021
# [3.1.0](v3.0.1...v3.1.0) (2021-06-17)

### Features

* new hooks `useThrottledEffect` and `useThrottledState` ([#137](#137)) ([1cc6677](1cc6677))
@xobotyi
Copy link
Contributor Author

xobotyi commented Jun 17, 2021

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@xobotyi xobotyi deleted the useThrottleEffect branch June 24, 2021 07:32
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