Socket
Socket
Sign inDemoInstall

event-emitter-mod

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    event-emitter-mod

A Moddable SDK/XS compatible Event Emitter utility.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
39.5 kB
Created
Weekly downloads
 

Readme

Source

Event Emitter Mod

This is an event emitter utility lib for working in the Moddable SDK. This implements a low brow solution that should work for small event driven applications.

Installation

git clone https://github.com/dashcraft/event-emitter-mod.git or git clone git@github.com:dashcraft/event-emitter-mod.git cd event-emitter-mod && yarn install yarn build

Copy the /event-emitter-mod folder into your moddable sdk project, then add the event-emitter-mod package to your projects manifest.json includes:

"./event-emitter-mod/manifest.json"

Usage

First import the primary package import EventEmitter from 'event-emitter-mod' Afterwards, globally or internally you can create a new event emitter...

let eventEmitter = new EventEmitter()
eventEmitter.addListener('test', function someCallback(data) {
    trace('data', data)
})

// then you can call...
eventEmitter.emit('test', "Hello world")

// expect a console.log of
"Hello world"

Todo

  • Tests, tests, more tests
  • Test memory consumption
  • Double check with moddable best practices

Keywords

FAQs

Last updated on 08 Jun 2021

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