postmessage-client
v1.0.0
Published
A client implementation for postMessage communication
Downloads
1
Readme
postmessage-client
Installation
npm install --save postmessage-client
Usage
You must use this module with postmessage-server module on the other side (remote window)
es6
import Client from '../src';
const client = new Client();
client.connect(window, window.opener);
client.get('test/route', {id: '1'}).then(data => {
console.log(data);
});
es5
var PMClient = require('postmessage-client');
var client = new PMClient();
client.connect(window.opener);
client.get('test/route').then(function (data) {
console.log(data);
});