Merge pull request #3905 from cseufert/master

Intercom.JS - Added off method
This commit is contained in:
Masahiro Wakame
2015-03-21 13:05:52 +09:00
2 changed files with 8 additions and 0 deletions

View File

@@ -17,4 +17,6 @@ function test_intercom_static() {
console.log(onceListenerInvokedTimes === 1);
instance.emit("eventWithoutAMessage");
instance.off("test", detect);
}

View File

@@ -17,6 +17,12 @@ declare module intercom {
* @param fn The listener method to invoke.
*/
on(name: string, fn: Function): void;
/**
* Remove a registered event listener
* @param name The string event listener name.
* @param fn The listener method to remove.
*/
off(name: string, fn: Function): void;
/**
* Given a unique key to represent the function, fn will be invoked in only one window. The ttl argument represents the number of seconds before the function can be called again.
* @param key The unique function identifier key