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

@imtbl/bus

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imtbl/bus

A communication bus for Immutable platform clients

  • 0.0.72
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Immutable Bus

A communication bus for cross-document communication based on pub/sub model.

Install


  npm install immutable-bus
  

To publish

    import { ImmutableBus } from 'immutable-bus';
    
    let immutableBus = new ImmutableBus("http://self");
    immutableBus.connectTo("http://window-1");
    immutableBus.publish("message-topic", 
        "http://window-1", {
        "msg": "hello from host 1"
    });

To subscribe


    let immutableBus = new ImmutableBus("http://self");
    immutableBus.connectTo("http://window-1");
    immutableBus.connectTo("http://window-2");
    immutableBus.subscribe('message-topic', (data) => {
      console.log(data); //prints any data from either windows
    });

To broadcast (only possible by parent/controller)

    import { ImmutableBus } from 'immutable-bus';

    let immutableBus = new ImmutableBus("http://self");
    immutableBus.broadcast("message-topic", {
        "msg": "hello from controller"
    });

Keywords

FAQs

Package last updated on 13 Nov 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

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