1.0.16 • Published 6 years ago

@pirireis/application-transport v1.0.16

Weekly downloads
-
License
-
Repository
-
Last release
6 years ago

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();
1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago