summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xREADME.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 698a0ab..9354932 100755
--- a/README.md
+++ b/README.md
@@ -2642,6 +2642,18 @@ function whenSomethingHappens() {
}
```
+You can also pass some data to the event:
+
+```javascript
+function whenSomethingHappens() {
+ rect.fire('my:event', {some:'data'})
+}
+
+rect.on('my:event', function(e) {
+ alert(e.detail.some) // outputs 'data'
+})
+```
+
_Important: always make sure you namespace your event to avoid conflicts. Preferably use something very specific. So `wicked:event` for example would be better than something generic like `svg:event`._
## Numbers