encore-publish-subscribe-service
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Encore Pub/Sub Service

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

Install

$ npm install encore-publish-subscribe-service

Usage

  1. Import Pub/Sub class
  2. Create an instance, using application name
  3. 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

Readme

Keywords

none

Package Sidebar

Install

npm i encore-publish-subscribe-service

Weekly Downloads

15

Version

1.0.1

License

none

Unpacked Size

5.58 kB

Total Files

6

Last publish

Collaborators

  • joaquinvolpe
  • dpiletski
  • shivalijindal
  • xiaottg
  • leonardo.moreno
  • galvogalvo
  • chasenyc
  • davidbrewer
  • paulrumyantsevitr
  • a.bobrovnik
  • yuriyibc
  • ipanfilenko