1.0.16 • Published 5 years ago

@pirireis/application-transport v1.0.16

Weekly downloads
-
License
-
Repository
-
Last release
5 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

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago