Coder Social home page Coder Social logo

jfusco / es6-event-emitter Goto Github PK

View Code? Open in Web Editor NEW
16.0 0.0 2.0 630 KB

Custom, simple, extendable event/messaging system written in ES6

License: MIT License

JavaScript 37.82% CSS 14.41% HTML 47.77%
es6 es2015 events pubsub pub-sub emitter listener jasmine karma karma-jasmine

es6-event-emitter's People

Contributors

cymen avatar dependabot[bot] avatar jfusco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

wkasel enrodroid

es6-event-emitter's Issues

.bablerc in npm package

I'm trying to use this with react-native and ran into it trying to run the .bablerc file from within node_modules. It blows up because of the plugin not being present. Apparently, the convention is becoming not to ship the .bablerc in the npm package by adding it to .npmignore.

facebook/react-native#4062

Are you onboard with that?

Triggering events before dom is ready

Hello,

I'm wondering if it's possible to trigger an event on the constructor, or a method that is called immediately after the class is instantiated.

I'm trying to do something like this;

class Bla extends Emitter {
  constructor() {
    super()
    this.trigger('bla:initialised')
}
}

I notice this event doesn't fire, probably because it hasn't fully loaded or something. How would you do something like this?

Cheers

Cannot find module 'babel-runtime/helpers/classCallCheck'

Hi there, your class looks promising! I am having problems, while trying it out: The compiler says this:

Error: Cannot find module 'babel-runtime/helpers/classCallCheck' from 'node_modules/es6-event-emitter/dist'

Any ideas what I should do about that?

Dependency on babel-runtime

Attempting to use es6-event-emitter without babel-runtime as a direct dependency results in this error:

module.js:327
    throw err;
    ^

Error: Cannot find module 'babel-runtime/helpers/classCallCheck'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/pwagener/Devel/callbacks/node_modules/es6-event-emitter/dist/emitter.js:7:24)
    at Module._compile (module.js:409:26)
    at Module._extensions..js (module.js:416:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/pwagener/Devel/callbacks/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
   ...

Adding babel-runtime as a direct dependency of my project seems to resolve it.

NPM Mismatch distro bundle

The fix for #3 is that the package needs to be updated in NPM. If you look in dist:

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
var _createClass2 = require('babel-runtime/helpers/createClass');
var _createClass3 = _interopRequireDefault(_createClass2);
var _weakMap = require('babel-runtime/core-js/weak-map');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.