Socket
Book a DemoInstallSign in
Socket

snorkel

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snorkel

Event Dispatcher

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Snorkel

:swimmer: Event Dispatcher

Build Status Code Quality Code Coverage

Usage

import EventDispatcher from 'snorkel'

// Listen for an event
EventDispatcher.on('welcome', (data) => {
  console.log('The welcome event happened with ' + data)
})

function isReady {
  console.log('The thing is ready')
}
// Listen for an event only once
EventDispatcher.once('ready', isReady)

// Emit an event
EventDispatcher.emit('welcome', 'emit', 'as', 'many', 'params', 'as', 'you', 'like')

// Remove event listener
EventDispatcher.off('ready', isReady)

// Clear all event dispatchers
EventDispatcher.clear()

Keywords

event

FAQs

Package last updated on 13 Jul 2015

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