Socket
Socket
Sign inDemoInstall

backbone-esnext-eventbus

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    backbone-esnext-eventbus

Provides a default main eventbus instance for backbone-esnext-events.


Version published
Weekly downloads
4
increased by100%
Maintainers
1
Install size
2.37 MB
Created
Weekly downloads
 

Changelog

Source

0.3.1 (2017-03-09)

  • Added Babel transform-runtime plugin.

Readme

Source

backbone-esnext-eventbus

NPM Documentation Code Style License Gitter

Build Status Coverage Dependency Status

Provides a default instance of backbone-esnext-events which may serve as a main eventbus. Please refer to backbone-esnext-events for detailed documentation. The main impetus for a default main eventbus being easily imported across modules is to facilitate message passing between modules versus direct dependencies / method invocation.

It should be noted that this module only depends on backbone-esnext-events which has no other dependencies.

An example follows:

import mainEventbus from 'backbone-esnext-eventbus';

mainEventbus.on('fire:test', () => { console.log('Test Fired!'); return 42; }

mainEventbus.trigger('fire:test');  // Prints 'Test Fired'!

const value = mainEventbus.triggerSync('fire:test');  // Prints 'Test Fired' and returns '42'!

assert(value === 42);

and in an entirely separate module / source file:

import mainEventbus from 'backbone-esnext-eventbus';

const value = mainEventbus.triggerSync('fire:test');  // Prints 'Test Fired' and returns '42'!

assert(value === 42);

There are also two other alternate eventbus instances provided as named exports: auxEventbus and pluginEventbus. These can be imported as follows:

import { auxEventbus } from 'backbone-esnext-eventbus';
import { pluginEventbus } from 'backbone-esnext-eventbus';

Keywords

FAQs

Last updated on 10 Mar 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc