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

Add ability to resolve/reject and hide #99

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

adrhumphreys
Copy link

Hey team,

Loving the library and I found that I often would call resolve and hide or reject and hide, and noticed that there was a similar pattern mentioned in #88

This would mean that users are able to do something like:

const {resolveAndHide} = useModal()

return (
  <Modal onClose={() => resolveAndHide(false)}>
   <p>Content</p>
  </Modal>
)

Happy to update with any feedback

Reason for creating new methods was to keep backwards compatibility

@codecov-commenter
Copy link

codecov-commenter commented Jan 17, 2023

Codecov Report

Merging #99 (70fa54b) into main (f146959) will decrease coverage by 2.88%.
The diff coverage is 25.00%.

@@             Coverage Diff             @@
##              main      #99      +/-   ##
===========================================
- Coverage   100.00%   97.12%   -2.88%     
===========================================
  Files            1        1              
  Lines          201      209       +8     
  Branches        30       30              
===========================================
+ Hits           201      203       +2     
- Misses           0        6       +6     
Impacted Files Coverage Δ
src/index.tsx 97.12% <25.00%> (-2.88%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@supnate
Copy link
Collaborator

supnate commented Jan 21, 2023

Hi @adrhumphreys , thanks for the PR! It looks good to me. Could you please also add unit tests for the new APIs so that it would be merged?

@adrhumphreys
Copy link
Author

Hey @supnate sorry for the long delay, just added in some tests now if you want to have a review over them, thanks

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.

3 participants