summaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rwxr-xr-xREADME.md11
1 files changed, 10 insertions, 1 deletions
diff --git a/README.md b/README.md
index 9c421a2..63f1d0b 100755
--- a/README.md
+++ b/README.md
@@ -2913,6 +2913,12 @@ Now you are ready to fire the event whenever you need:
function whenSomethingHappens() {
rect.fire('myevent')
}
+
+// or if you want to pass an event
+function whenSomethingHappens(event) {
+ rect.fire(event)
+}
+
```
You can also pass some data to the event:
@@ -2937,9 +2943,12 @@ rect.on('myevent.namespace', function(e) {
// do something
})
-// detach all handlers of namespace
+// detach all handlers of namespace for myevent
rect.off('myevent.namespace')
+// detach all handlers of namespace
+rect.off('.namespace')
+
// detach all handlers including all namespaces
rect.off('myevent)
```