<commit_before>EventMachine
================

[![Build Status](https://img.shields.io/travis/Addvilz/eventmachine.svg?style=flat-square)](https://travis-ci.org/Addvilz/eventmachine)
[![NPM](https://img.shields.io/npm/v/eventmachine.svg?style=flat-square)](https://www.npmjs.com/package/eventmachine)
[![Bower](https://img.shields.io/bower/v/eventmachine.svg?style=flat-square)](http://bower.io/search/?q=eventmachine)
[![Release](https://img.shields.io/github/release/Addvilz/eventmachine.svg?style=flat-square)](https://github.com/Addvilz/eventmachine/releases)
[![Apache-2.0](https://img.shields.io/npm/l/eventmachine.svg?style=flat-square)](https://github.com/Addvilz/eventmachine/)

EventMachine is a light-weight implementation of event emitter.

### Why another one?!

I needed a event emitter that:

1. works in a browser;
2. is not a resource hog (EventMachine is just 1.4kB minified);
3. has no external dependencies;
4. callbacks be executed in a fresh stack;
5. with a learning curve analogue to that of banana;

### What's the difference between EventMachine and X?

EventMachine is pretty similar to a lot of other event emmiters out there, with the only major difference being that all event handler calls are wrapped inside a JavaScript `setTimeout` function call with a timeout value `0`.

This forces the event handlers to be placed and executed at the end of the execution stack by 'pausing' JavaScript execution providing time for the rendering threads in the browser to catch up.

I found this to be a major issue while using other event emmiter implementations, for example, the one from backbone.<commit_msg>Switch to HTTP version of shields<commit_after>EventMachine
================

[![Build Status](http://img.shields.io/travis/Addvilz/eventmachine.svg?style=flat-square)](https://travis-ci.org/Addvilz/eventmachine)
[![NPM](http://img.shields.io/npm/v/eventmachine.svg?style=flat-square)](https://www.npmjs.com/package/eventmachine)
[![Bower](http://img.shields.io/bower/v/eventmachine.svg?style=flat-square)](http://bower.io/search/?q=eventmachine)
[![Release](http://img.shields.io/github/release/Addvilz/eventmachine.svg?style=flat-square)](https://github.com/Addvilz/eventmachine/releases)
[![Apache-2.0](http://img.shields.io/npm/l/eventmachine.svg?style=flat-square)](https://github.com/Addvilz/eventmachine/)

EventMachine is a light-weight implementation of event emitter.

### Why another one?!

I needed a event emitter that:

1. works in a browser;
2. is not a resource hog (EventMachine is just 1.4kB minified);
3. has no external dependencies;
4. callbacks be executed in a fresh stack;
5. with a learning curve analogue to that of banana;

### What's the difference between EventMachine and X?

EventMachine is pretty similar to a lot of other event emmiters out there, with the only major difference being that all event handler calls are wrapped inside a JavaScript `setTimeout` function call with a timeout value `0`.

This forces the event handlers to be placed and executed at the end of the execution stack by 'pausing' JavaScript execution providing time for the rendering threads in the browser to catch up.

I found this to be a major issue while using other event emmiter implementations, for example, the one from backbone.
{'fraction_non_alphanumeric': 0.12274809160305343, 'fraction_numerical': 0.0061068702290076335, 'mean_word_length': 5.251908396946565, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 13, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2571770', 'n_tokens_mistral': 992, 'n_tokens_neox': 936, 'n_words': 324}