0.1.1 • Published 3 years ago

@daocasino/platform-messaging v0.1.1

Weekly downloads
15
License
MIT
Repository
github
Last release
3 years ago

Iframe messaging

This library allows you to wrap your classes and use them over iframe

Usage

  1. Wrap your class in parent window
const iframeMessagingProvider = await IframeMessagingProvider.create('parent', 'child-iframe')
iframeMessagingProvider.exposeService('MyService', new MyServiceClass())
  1. 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

Example

$ yarn start:example
0.1.1

3 years ago

0.1.0

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago