From f246b73e4e19769e556765aac2fa988f7bb5a428 Mon Sep 17 00:00:00 2001 From: Pawel Wolak Date: Thu, 1 Sep 2016 10:40:04 +0200 Subject: [PATCH] added missing methods and parameters to documentation --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 94ae484..71210da 100644 --- a/README.md +++ b/README.md @@ -82,9 +82,17 @@ This requires you to send a unique identifier for each message from the socket.i ## Methods -### .emit(name, message) +### .bind(object, options) -Broadcasts a message to all open windows (including the current window). +Adds new binding. + +### .emit(name, message, [id]) + +Broadcasts a message to all open windows (including the current window), with optional identifier. + +### .off(name, fn) + +Removes `fn` listener for messages with the given name. ### .on(name, fn) @@ -94,6 +102,10 @@ Sets up a listener to be invoked when a message with the given name is received. Given a unique 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. +### .trigger(name) + +Manually triggers callbacks for `name`, passing additional parameters as callback arguments. + ### Intercom.destroy() Removes all data associated with intercom from `localStorage`.