@pirireis/application-transport

1.0.16 • Public • Published

Application Transport

application-transport is for sending specified messages to iframe apps and getting from iframe apps.

How to add dependency

yarn add @pirireis/application-transport

How to use

sending messages from parent app:

const transport = new Transport({iframeId: '', applicationId: ''});
transport.sendMessage(EventTypes.POINT, coordinates);

iframeId is the id of the iframe that used. applicationId is the constant id of the child application.

There are three EventTypes:

POINT, POLYLINE, POLYGON

coordinates format example for POINT:

[35.12, 42.10]

getting messages from child application:

const transport = new Transport({applicationId: ''});  
transport.on(EventTypes.POINT, (data) => {  });

removing eventListener:

this should be in componentWillUnmount lifecycle:

const transport = new Transport({applicationId: ''});
transport.removeListener();

Readme

Keywords

none

Package Sidebar

Install

npm i @pirireis/application-transport

Weekly Downloads

1

Version

1.0.16

License

none

Unpacked Size

17.8 kB

Total Files

9

Last publish

Collaborators

  • ahmetklnc
  • serhat.kanbas.pirireis
  • leventatay
  • hh_pr
  • mozyurt
  • haberci