• Stars
    star
    194
  • Rank 200,050 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 8 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The lightweight es6 event library.

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

More Repositories

1

spacebadgers

Fast and clean SVG badges
Rust
252
star
2

rust-talks

Community maintained list of Rust talks.
29
star
3

Animus

The educational Animus malware
C#
17
star
4

spotify-rs

Rustified Spotify API.
Rust
9
star
5

Hashlecter

Free and libre hash reversal tool.
C#
5
star
6

plasmid

Rust Genetic Engineering Kit
Rust
3
star
7

flux1-cli

Easy local FLUX.1 Inference
Python
3
star
8

ampbar

A modern status bar with mouse and touch support.
JavaScript
3
star
9

RektOS2

A small operating system
C
3
star
10

deepin-macos-transform

Make DeepinOS even more awesome
Shell
2
star
11

cmc

Inofficial coinmarketcap.com desktop app.
JavaScript
2
star
12

DOMinate.js

HTML element creation in JS using CSS selectors
JavaScript
2
star
13

iosh

Supercharged Iodine REPL shell.
C#
2
star
14

chippy

CHIP-8 emulator written in C# 6
C#
2
star
15

CSON.Net

CSON parser, serializer and deserializer for .NET
C#
2
star
16

subtle

Beautiful subtle particle effects using canvas.
JavaScript
2
star
17

cn-miner-rs

A CryptoNight miner written in Rust.
Rust
2
star
18

hawkeye

A simple and extensible React Dashboard
TypeScript
1
star
19

Imardin

The Imardin Virtual Machine
C
1
star
20

zircond

Rust IRC daemon.
Rust
1
star
21

JacoChat

JacoChat protocol library and single-room client
C#
1
star
22

cap

A binary package manager for crates.io
Rust
1
star
23

Tesseract

A hobbyist operating system
C
1
star
24

dotfiles

Some useful dotfiles
Shell
1
star
25

hueston

Philips Hue manipulation in Rust.
Rust
1
star
26

Devulcanizer

Windows Service to find and destroy the Vulcan malware
C#
1
star
27

libObsidian-Client

Obsidian client library for Microsoft .Net and Mono
C#
1
star
28

witty

A small irc bot
Python
1
star