Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pirireis/application-transport

Package Overview
Dependencies
Maintainers
5
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pirireis/application-transport

Send and Get messages for iframe

  • 1.0.16
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
5
Weekly downloads
 
Created
Source

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

FAQs

Package last updated on 04 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc