talkman
A simple, lightweight and flexible communication API. Define your own mechanism to send/receive your messages and leave the rest to us
(to be continued...)
sample code
import CommAPI, {TransportBrowserWindow} from 'talkman';
let source = window;
let target = window.parent
const transport = new TransportBrowserWindow ({
sourceWindow : source,
targetWindow : target
});
const incomingInfo = (payload) => {
console.log (payload);
};
const incomingRequest = (payload) => {
let res = {};
try {
res = {};
return res;
}
catch (err) {
throw err;
}
};
const messenger = new CommAPI ({
transportInstance: transport,
onReq: incomingRequest,
onInfo: incomingInfo
});
const info = {};
messenger.sendInfo (info);
const req = {};
messenger.sendReq (req).then (
(response) => {
},
(err) => {
}
)