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

chore: specify type for clipboard #82

Merged
merged 1 commit into from
Mar 18, 2020
Merged

Conversation

Naturalclar
Copy link
Member

Summary

Made the return type of useClipBoard more specific.

Originally, the inferred return type was (string | typeof setString)[]; which makes it very difficult to use in typescript, because it is unsure weather first element of the array is string or setString.

By explicitly setting the return type, typescript will know that first item in the array is a string, and second item in the array is a function.

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS ✅❌
Android ✅❌
Web ✅❌

Checklist

  • I have tested this on a device and a simulator
  • I updated the typed files (TS and Flow)

@Naturalclar Naturalclar requested a review from pvinis March 17, 2020 13:49
Copy link
Member

@LinusU LinusU left a comment

Choose a reason for hiding this comment

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

Neat 👍

@pvinis pvinis added patch Increment the patch version when merged release Create a release when this pr is merged labels Mar 18, 2020
@pvinis pvinis merged commit 1755863 into master Mar 18, 2020
@pvinis
Copy link
Member

pvinis commented Mar 18, 2020

🚀 PR was released in v2.4.6 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants