All Projects → SplittyDev → Evee.js

SplittyDev / Evee.js

Licence: mit
The lightweight es6 event library.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Evee.js

babel-plugin-source-map-support
A Babel plugin which automatically makes stack traces source-map aware
Stars: ✭ 41 (-79.08%)
Mutual labels:  babel, npm-package
react-multi-context
Manage multiple React 16 contexts with a single component.
Stars: ✭ 19 (-90.31%)
Mutual labels:  babel, npm-package
Express React Boilerplate
🚀🚀🚀 This is a tool that helps programmers create Express & React projects easily base on react-cool-starter.
Stars: ✭ 32 (-83.67%)
Mutual labels:  babel, npm-package
react-innertext
Returns the innerText of a React JSX object.
Stars: ✭ 37 (-81.12%)
Mutual labels:  babel, npm-package
Forge Node App
🛠📦🎉 Generate Node.js boilerplate with optional libraries & tools
Stars: ✭ 90 (-54.08%)
Mutual labels:  babel, npm-package
Node Regedit
Read, Write, List and do all sorts of funky stuff to the windows registry using node.js and windows script host
Stars: ✭ 178 (-9.18%)
Mutual labels:  npm-package
Darkmode.js
🌓 Add a dark-mode / night-mode to your website in a few seconds
Stars: ✭ 2,339 (+1093.37%)
Mutual labels:  npm-package
Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (-8.67%)
Mutual labels:  babel
Advanced React Webpack Babel Setup
The advanced React, Webpack, Babel Setup. You want to get beyond create-react-app?
Stars: ✭ 176 (-10.2%)
Mutual labels:  babel
Babel Plugin Macros
🎣 Allows you to build simple compile-time libraries
Stars: ✭ 2,366 (+1107.14%)
Mutual labels:  babel
Modern Backbone Starterkit
Lightweight starting point for a modern backbone web app.
Stars: ✭ 189 (-3.57%)
Mutual labels:  babel
Trash
Move files and directories to the trash
Stars: ✭ 2,293 (+1069.9%)
Mutual labels:  npm-package
Fable
F# to JavaScript Compiler
Stars: ✭ 2,282 (+1064.29%)
Mutual labels:  babel
Run Electron
Run Electron without all the junk terminal output
Stars: ✭ 187 (-4.59%)
Mutual labels:  npm-package
React Sticky El
Stars: ✭ 179 (-8.67%)
Mutual labels:  npm-package
Grunt Eslint
Validate files with ESLint
Stars: ✭ 189 (-3.57%)
Mutual labels:  npm-package
Feathericon
simply generic vector icon collection - including sketch file, svg files, and font files.
Stars: ✭ 178 (-9.18%)
Mutual labels:  npm-package
Typescript Webpack React Redux Boilerplate
React and Redux with TypeScript
Stars: ✭ 182 (-7.14%)
Mutual labels:  babel
React Redux Webpack Starter
Learning react
Stars: ✭ 189 (-3.57%)
Mutual labels:  babel
Blynk Library Js
Blynk library for JS. Works with Browsers, Node.js, Espruino.
Stars: ✭ 181 (-7.65%)
Mutual labels:  npm-package

GitHub license npm Travis Gratipay

evee.js

The blazing fast ES6 event library.

Evee is a lightweight event library, written in clean ECMAScript6.
Evee exports both an ES5 and an ES6 version to support a wide range of clients.

Status

The project is still actively maintained, but the functionality is complete.
Bugs will still be fixed and feature requests are more than welcome.

How to upgrade from evee 1.x to evee 2.1.0+

As of version 2.1.0, evee exports two entry points: evee and evee/es6.
The evee export is what you're used to, and will work with all ES5 compatible targets.
The evee/es6 export is the ES6 version of evee, which is generally faster.

If you wanna keep using the ES5 version, you don't need to change anything!
If you wanna upgrade to the beautiful ES6 version, here's how to do it:

// Importing evee/es6 (require)
const Evee = require('evee/es6'),
      evee = new Evee;

// Importing evee/es6 (ES6 modules)
import Evee from 'evee/es6';
const  evee = new Evee;

How to use

// Grab a new evee instance
const Evee = require('evee/es6'),
      evee = new Evee;

// Subscribe to the 'update' event
evee.on('update', e => console.log(`Ticks: ${e.data}`));

var ticks = 0;
while(true) {

  // Dispatch the 'update' event
  evee.emit('update', ++ticks);
}

You can also keep track of your event listeners unsubscribe from events you don't need anymore.

// Grab a new evee instance
const Evee = require('evee/es6'),
      evee = new Evee;

// Subscribe to the 'say' event
var receiver = evee.on('say', e => console.log(e.data));

// Dispatch the 'say' event
evee.emit('say', 'Hello, world!');

// Unsubscribe from the 'say' event
evee.drop(receiver);

If you want to fire an event only once, you can do that too!
The event will be automatically removed after the first usage:

// Grab a new evee instance
const Evee = require('evee/es6'),
      evee = new Evee;

// Subscribe to the 'say' event
evee.once('say', e => console.log('hello, world'));

// Dispatch the 'say' event two times
evee.signal('say');
evee.signal('say');

// hello, world is only printed once!

As you can see, evee is really easy to use!
Start using evee today and stop worrying about slow events :)

Running the benchmarks

$ git clone [email protected]:SplittyDev/evee.js.git
$ cd evee.js
$ npm install --only=dev
$ npm run-script bench-dev
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].