Bläddra i källkod

chore: hook docs

Ryan Chandler 3 år sedan
förälder
incheckning
5c8630abef
1 ändrade filer med 14 tillägg och 0 borttagningar
  1. 14 0
      README.md

+ 14 - 0
README.md

@@ -67,6 +67,20 @@ Since you can pass any properties through to the `$clipboard` function, if you p
 
 The clipboard will now contain `["foo","bar"]`.
 
+### Hooks
+
+If you are using the `npm` installation method for this package or the ESM distribution, you can use the `Clipboard.configure()` method to attach an `onCopy` hook to the clipboard.
+
+```js
+import Clipboard from '@ryangjchandler/alpine-clipboard'
+
+Alpine.plugin(Clipboard.configure({
+    onCopy: () => {
+        console.log('Copied!')
+    }
+}))
+```
+
 ## Versioning
 
 This projects follow the [Semantic Versioning](https://semver.org/) guidelines.