diff --git a/README.md b/README.md index 68e3fdb9..40f8d5d3 100644 --- a/README.md +++ b/README.md @@ -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) { @@ -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); -}); -``` \ No newline at end of file