Skip to content

Commit

Permalink
Updated README with information on the target and callback args that …
Browse files Browse the repository at this point in the history
…can be passed to signalReady()
  • Loading branch information
ifandelse committed Dec 7, 2016
1 parent 5f4ea4b commit a138d7b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ postal.fedx.addFilter([
// to share
postal.fedx.signalReady();

// signalReady can also take two arguments: a target iframe (or array of targets), and a
// callback. The callback will be invoked anytime the remote postal instance responds to
// the ping sent when federating with it. This means if you passed an array of four targets,
// the callback should be invoked four times.
postal.fedx.signalReady(
[ target1, target2 ],
function( info ) {
// a source prop exist on info as well, FYI
console.log( "federated with:", info.instanceId );
}
);

// This message will be published locally as well as sent across to the remote postal
// instances of any federated iframes
postal.publish({
Expand Down

0 comments on commit a138d7b

Please sign in to comment.