Coder Social home page Coder Social logo

emmett's Introduction

๐Ÿ‘‹ Hello!

I'm Alexis Jacomy, aka @jacomyal, a Front-End Engineer specialized in graphical rendering and data visualization.

I'm part of the innovative team at OuestWare, an agency based in Nantes, France. We specialize in developing web applications for data exploration.

As a part of my work at OuestWare, I'm the main developer and maintainer of sigma.js, an open-source library focused on efficiently displaying networks within web pages.

We also develop:

  • Gephi Lite a web-based, lighter version of Gephi, the networks visualization and exploration software;
  • Retina, a web application to share graph visualizations online.

Finally, I sometimes write on ๐Ÿ˜ Mastodon or on ๐Ÿ—’ OuestWare's blog.

Thank you for visiting, and let's connect!

emmett's People

Contributors

ayalpani avatar christianalfoni avatar codyray avatar iaspin92 avatar jacomyal avatar matthewwithanm avatar mjhasbach avatar yomguithereal avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

emmett's Issues

#off(handler) fails with symbols

const Emitter = require("emmett");
const emitter = new Emitter();
const event = Symbol("myEvent");

let count = 0;
const handler = function() { count++; }

emitter.on(event, handler);
emitter.off(handler);
emitter.emit(event);

console.log("Count:", count);

Expected result:

Should log Count: 0

Actual result:

Should log Count: 1

Event names enumerator

Can we add some option to enumerate all possible event names?

This is valuable because:

  1. users will have an official place to check for possible emit options
  2. we get errors when event name is mistyped

Something like:

import Emmett from "emmett";

let emitter = new Emmett([
  "scale.mouseDown"
]);

emitter.on("scale.mouseDown", (data) => {
  console.log("scale.mouseDown!");
});

emitter.emit("scale.mouseDown"); // CONSOLE.LOG
emitter.emit("scale.mouseUp"); // ERROR!

I don't know how it's better to adopt this to custom emitters (inheritance) but there are some ways...

#emit breaks with symbols and complex handlers

const Emitter = require("emmett");
const emitter = new Emitter();

emitter.on(/some pattern/, function() {});
emitter.emit(Symbol("myEvent"));

console.log("All good.");

Expected result:

Should log All good.

Actual result:

Throws TypeError: event.search is not a function

Symbol-keys are ignored when using pair events

Hi there,

just noticed you've added Symbol support. There is one bug though when using pair events like this:

myEmitter.on({
  myEvent1: function(e) {  },
  myEvent2: function(e) {  }
});

Since Symbols can not be enumerated with for ... in or Object.keys(events).on they are just being ignored in such cases.

Sorry, I don't have time for a proper PR, but here is a possible solution

// instead of using `for ... in` you can process each key type individually

// Symbol-keys
Object.getOwnPropertySymbols(events).forEach(function(event){
     // this.on/off/etc....
});

// String-keys
Object.getOwnPropertyNames(events).forEach(function(event){
     // this.on/off/etc....
});

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.