🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

encore-publish-subscribe-service

Package Overview
Dependencies
Maintainers
6
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

encore-publish-subscribe-service

Publisher/Subscriber class that allows us connect applications or modules inside application

1.0.1
latest
npm
Version published
Weekly downloads
1
Maintainers
6
Weekly downloads
 
Created
Source

Encore Pub/Sub Service

Publisher/Subscriber class that allows us connect applications or modules inside application

Install

$ npm install encore-publish-subscribe-service

Usage

  • Import Pub/Sub class
  • Create an instance, using application name
  • Use Encore Pub/Sub instance

Documentation

Library is working with special event format: {widget name}_{view name}_{event name} View name could be empty. Widget and event names should use dash as a word separator.

Service provide two groups of connection methods and one helper method for event name generation:

Publish methods

emit - call event on specific HTML element globalEmit - call event on window

Subscribe methods

subscribe - listen to event on specific HTML element, return unsubscribe function globalSubscribe - listen to event on window

Helper method

getEventName - return formatted event name

FAQs

Package last updated on 11 Jul 2019

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