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

eventualize

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eventualize

A JavaScript microlibrary for automatic event binding

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Eventualize

convention-based automatic event binding for EventEmitters in your object-oriented JavaScript code

Circle CI Dependency Status devDependency Status

class Stream

  constructor: ->
    @socket = new Socket()

    # This call wires up all properly named event listeners in this class.
    # It is equivalent to running:
    # @socket.on 'open', @onSocketOpen
    # @socket.on 'data', @onSocketData
    # @socket.on 'error', @onSocketError
    eventualize this


  @onSocketOpen = (err, handle) -> ...
  @onSocketData = (err, data) -> ...
  @onSocketError = (err, message) -> ...

This also works for jQuery event emitters in the browser:

class ConfirmDialog

  constructor: ->
    @confirmButton = $('#confirm')
    @cancelButton = $('#cancel')

    # This call is equivalent to
    # @confirmButton.on 'click', @onConfirmButtonClick
    # @cancelButton.on 'click', @onCancelButtonClick
    # @cancelButton.on 'hover', @onCancelButtonHover
    eventualize this

  @onConfirmButtonClick: -> ...
  @onCancelButtonClick: -> ...
  @onCancelButtonHover: -> ...

Development

See the developer guidelines

FAQs

Package last updated on 29 Feb 2016

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