Skip to content

Commit

Permalink
Events collection created dynamically. Closes scottcorgan#3
Browse files Browse the repository at this point in the history
  • Loading branch information
scottcorgan committed Jan 6, 2014
1 parent 04aca98 commit d7e4835
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tiny-emitter",
"main": "dist/tinyemitter.js",
"version": "0.1.6",
"version": "0.1.7",
"homepage": "https://github.com/scottcorgan/tiny-emitter",
"authors": [
"Scott Corgan <[email protected]>"
Expand Down
5 changes: 3 additions & 2 deletions dist/tinyemitter.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.TinyEmitter=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
function E () {
this.e = {};
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
}

E.prototype = {
on: function (name, callback, ctx) {
var e = this.e;
var e = this.e || (this.e = {});

(e[name] || (e[name] = [])).push({
fn: callback,
Expand Down
2 changes: 1 addition & 1 deletion dist/tinyemitter.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
function E () {
this.e = {};
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
}

E.prototype = {
on: function (name, callback, ctx) {
var e = this.e;
var e = this.e || (this.e = {});

(e[name] || (e[name] = [])).push({
fn: callback,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tiny-emitter",
"version": "0.1.6",
"version": "0.1.7",
"description": "A tiny (less than 1k) event emitter library",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d7e4835

Please sign in to comment.