Skip to content

Commit

Permalink
change promise to callback - weight saving -
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatanabe committed Jun 20, 2016
1 parent 763cbfa commit bd56c74
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 1,144 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ tinycopy.on('error', function(err) {

// copy from text2
element.addEventListener('click', function () {
TinyCopy.exec('hello').then(function (data) {
// onCopyCompleted
}).catch(function (err) {
// onCopyFailed
TinyCopy.exec('hello', function(err, data) {
if (!err) {
// onCopyFailed
} else {
// onCopyCompleted
}
});
});
```
Expand Down

0 comments on commit bd56c74

Please sign in to comment.