Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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`.
Expand Down