-
Notifications
You must be signed in to change notification settings - Fork 123
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 onSuccess and onFail callback #53
Conversation
src/Component.js
Outdated
const elem = React.Children.only(children); | ||
|
||
copy(text, options); | ||
const result = copy(text, options); | ||
|
||
if (onCopy) { | ||
onCopy(text); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just do onCopy(text, result)
instead, and keep API small
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's fine. Would be great to have this cgange in the readme
README.md
Outdated
@@ -118,6 +118,7 @@ Text to be copied to clipboard | |||
Optional callback, will be called when text is copied | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably worth adding short note to the readme too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It that ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🙏
sorry, can you publish? please. |
Cheers! |
add api onSuccess and onFail