This library allows you to wrap your classes and use them over iframe
- Wrap your class in parent window
const iframeMessagingProvider = await IframeMessagingProvider.create('parent', 'child-iframe')
iframeMessagingProvider.exposeService('MyService', new MyServiceClass())
- Write client code in child window
const iframeMessagingProvider = await IframeMessagingProvider.create('child')
const myService = iframeMessagingProvider.getRemoteService<MyService>('MyService')
const result = await myService.anyMethod(param1, param2)
Don't forget to call stopService
and destory
for correctly close on window unload
$ yarn start:example