Nominating Presidential Muppets
Wondering what’s next for npm?Check out our public roadmap! »

@availity/message-core
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Availity message

A package wrapping the postMessage function with helper functions and security checks.

Install

npm install @availity/message-core

how to use

import avMessage from '@availity/message-core

Methods

subscribe

const unsubscribe = avMessage.subscribe(event, fn) when a message event is received and verified, fn will be called with the event data.

it returns a function that can be used to unsubscribe from that event

unsubscribe

avMessage.unsubscribe(eventName) will remove all listeners for this event.

unsubscribeAll

avMessage.unsubscribeAll() will remove all listeners for all events.

enabled

if a value is passed in, sets messaging's enabled flag true/false based on value.

returns boolean enabled flag value.

domain

returns a string of the windows current domain.

send

avMessage.send(payload, target) will send the payload to the target if AvMessage is enabled. target defaults to the parent window. payload will be stringified if not a string.

Authors

Kasey Powers

License

MIT

Keywords

none

Install

npm i @availity/[email protected]

Version

2.0.0

License

MIT

Unpacked Size

61.6 kB

Total Files

14

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar