Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Brain committed Feb 27, 2016
1 parent 8157803 commit babbb20
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,29 @@ and fail gracefully if it does not.

// In one window

postRobot.on('getCart', function(err, data, callback) {
return callback({
amount: 1
});
});

// In another window

postRobot.send(window, 'getCart', function(err, data) {
console.log(data);
});
```

## Long form

```javascript

// In one window

postRobot.listen({

window: window.opener,

name: 'getCart',

handler: function(data, callback) {
Expand Down Expand Up @@ -60,17 +81,3 @@ postRobot.request({
});

```

## Shortcuts

```
postRobot.on('getCart', function(err, data, callback) {
return callback({
amount: 1
});
});
postRobot.send(window, 'getCart', function(err, data) {
console.log(data);
});
```

0 comments on commit babbb20

Please # to comment.