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 onSuccess and onFail callback #53

Merged
merged 5 commits into from
Mar 23, 2017
Merged

add onSuccess and onFail callback #53

merged 5 commits into from
Mar 23, 2017

Conversation

lama-pacos
Copy link
Contributor

@lama-pacos lama-pacos commented Mar 20, 2017

add api onSuccess and onFail

src/Component.js Outdated
const elem = React.Children.only(children);

copy(text, options);
const result = copy(text, options);

if (onCopy) {
onCopy(text);
Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now?

Copy link
Owner

@nkbt nkbt left a 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



Copy link
Owner

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It that ok?

Copy link
Owner

@nkbt nkbt left a comment

Choose a reason for hiding this comment

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

Thanks 🙏

@lama-pacos
Copy link
Contributor Author

lama-pacos commented Apr 10, 2017

sorry, can you publish? please.

@nkbt

@nkbt
Copy link
Owner

nkbt commented Apr 12, 2017

+ react-copy-to-clipboard@4.3.0
✔

Cheers!

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.

2 participants