Socket
Socket
Sign inDemoInstall

ainojs-events

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ainojs-events

Simple event interface, suitable for prototype mixin


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

Events

Simple event interface, suitable for mixin.

Example:

var GreatStuff = function() {
  // Apply the mixin
  Events.mixin(this)
}

GreatStuff.prototype.whatever = function() {
  this.trigger('whatever', { foo: 'bar' })
}

// [...]

var stuff = new GreatStuff()
stuff.on('whatever', function(e) {
  console.log(e.foo) // "bar"
})
stuff.whatever()

Now your class will implement a simple event interface.

Methods:

on(type, callback)
off(type[, callback])
trigger(type[, params])
once(type, callback)

FAQs

Package last updated on 08 Dec 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

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