Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 19afbbc

Browse files
committed
Merge branch 'release/4.2.9'
2 parents 4ad612d + db0faf6 commit 19afbbc

10 files changed

+1400
-1400
lines changed

EventEmitter.js

+464-464
Large diffs are not rendered by default.

EventEmitter.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
{
2-
"name": "eventEmitter",
3-
"description": "Event based JavaScript for the browser",
4-
"version": "4.2.8",
5-
"main": [
6-
"./EventEmitter.js"
7-
],
8-
"author": {
9-
"name": "Oliver Caldwell",
10-
"web": "http://oli.me.uk/"
11-
},
12-
"licenses": [
13-
{
14-
"type": "MIT",
15-
"url": "https://github.com/Wolfy87/EventEmitter#license-mit"
16-
}
17-
],
18-
"keywords": [
19-
"events",
20-
"structure"
21-
],
22-
"ignore": [
23-
"docs",
24-
"tests",
25-
"tools",
26-
".gitignore",
27-
"package.json"
28-
]
29-
}
2+
"name": "eventEmitter",
3+
"description": "Event based JavaScript for the browser",
4+
"version": "4.2.9",
5+
"main": [
6+
"./EventEmitter.js"
7+
],
8+
"author": {
9+
"name": "Oliver Caldwell",
10+
"web": "http://oli.me.uk/"
11+
},
12+
"licenses": [
13+
{
14+
"type": "MIT",
15+
"url": "https://github.com/Wolfy87/EventEmitter#license-mit"
16+
}
17+
],
18+
"keywords": [
19+
"events",
20+
"structure"
21+
],
22+
"ignore": [
23+
"docs",
24+
"tests",
25+
"tools",
26+
".gitignore",
27+
"package.json"
28+
]
29+
}

component.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "eventEmitter",
3-
"repo": "Wolfy87/EventEmitter",
4-
"description": "Event based JavaScript for the browser.",
5-
"version": "4.2.8",
6-
"scripts": ["EventEmitter.js"],
7-
"main": "EventEmitter.js",
8-
"license": "MIT"
2+
"name": "eventEmitter",
3+
"repo": "Wolfy87/EventEmitter",
4+
"description": "Event based JavaScript for the browser.",
5+
"version": "4.2.9",
6+
"scripts": ["EventEmitter.js"],
7+
"main": "EventEmitter.js",
8+
"license": "MIT"
99
}

docs/guide.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ I love AMD, so I implemented it in EventEmitter. If the script is loaded into a
5454

5555
```javascript
5656
require(['EventEmitter'], function(EventEmitter) {
57-
var ee = new EventEmitter();
57+
var ee = new EventEmitter();
5858
});
5959
```
6060

@@ -109,7 +109,7 @@ A listener is a function that is executed when an event is emitted. You can add
109109

110110
```javascript
111111
function listener() {
112-
console.log('The foo event has been emitted.');
112+
console.log('The foo event has been emitted.');
113113
}
114114

115115
ee.addListener('foo', listener);
@@ -119,11 +119,11 @@ You can also add in bulk using the `addListeners` method (notice the "s" on the
119119

120120
```javascript
121121
function listener1() {
122-
console.log('ONE');
122+
console.log('ONE');
123123
}
124124

125125
function listener2() {
126-
console.log('TWO');
126+
console.log('TWO');
127127
}
128128

129129
ee.addListeners('foo', [listener1, listener2]);
@@ -133,20 +133,20 @@ The second way of calling addListeners involves passing an object of event names
133133

134134
```javascript
135135
function listener1() {
136-
console.log('ONE');
136+
console.log('ONE');
137137
}
138138

139139
function listener2() {
140-
console.log('TWO');
140+
console.log('TWO');
141141
}
142142

143143
function listener3() {
144-
console.log('THREE');
144+
console.log('THREE');
145145
}
146146

147147
ee.addListeners({
148-
foo: [listener1, listener2],
149-
bar: listener3
148+
foo: [listener1, listener2],
149+
bar: listener3
150150
});
151151
```
152152

@@ -156,7 +156,7 @@ This works in the _exact_ same way as adding listeners. The only difference is t
156156

157157
```javascript
158158
function listener() {
159-
console.log('The foo event has been emitted.');
159+
console.log('The foo event has been emitted.');
160160
}
161161

162162
ee.addListener('foo', listener);
@@ -167,15 +167,15 @@ If you want a listener to remove itself after it has been called or after a cond
167167

168168
```javascript
169169
function listener1() {
170-
// If a condition is met then remove the listener
171-
if(completed) {
172-
return true;
173-
}
170+
// If a condition is met then remove the listener
171+
if(completed) {
172+
return true;
173+
}
174174
}
175175

176176
function listener2() {
177-
// Always remove after use
178-
return true;
177+
// Always remove after use
178+
return true;
179179
}
180180

181181
ee.addListeners('foo', [listener1, listener2]);
@@ -186,8 +186,8 @@ If you do not want to, or can't for some reason, return true, you can set the re
186186

187187
```javascript
188188
function listener() {
189-
// Always remove after use
190-
return 'REMOVE-ME';
189+
// Always remove after use
190+
return 'REMOVE-ME';
191191
}
192192

193193
ee.addListener('foo', listener);
@@ -199,7 +199,7 @@ Alternatively you can use the `addOnceListener` method, or it's alias, `once`.
199199

200200
```javascript
201201
function listener() {
202-
// Do stuff
202+
// Do stuff
203203
}
204204

205205
ee.addOnceListener('foo', listener);
@@ -214,11 +214,11 @@ You can also remove whole events and all of their attached listeners with the `r
214214

215215
```javascript
216216
function listener1() {
217-
console.log('ONE');
217+
console.log('ONE');
218218
}
219219

220220
function listener2() {
221-
console.log('TWO');
221+
console.log('TWO');
222222
}
223223

224224
ee.addListeners('foo', [listener1, listener2]);
@@ -233,11 +233,11 @@ If you really need to then you can get an array of all listeners attached to an
233233

234234
```javascript
235235
function listener1() {
236-
console.log('ONE');
236+
console.log('ONE');
237237
}
238238

239239
function listener2() {
240-
console.log('TWO');
240+
console.log('TWO');
241241
}
242242

243243
ee.addListeners('foo', [listener1, listener2]);
@@ -250,11 +250,11 @@ So once you have added your listeners and you are ready to start executing them,
250250

251251
```javascript
252252
function listener1() {
253-
console.log('ONE');
253+
console.log('ONE');
254254
}
255255

256256
function listener2() {
257-
console.log('TWO');
257+
console.log('TWO');
258258
}
259259

260260
ee.addListeners('foo', [listener1, listener2]);
@@ -265,7 +265,7 @@ For more control, you can pass an arguments array as the second argument. This a
265265

266266
```javascript
267267
function adder(a, b) {
268-
console.log(a + b);
268+
console.log(a + b);
269269
}
270270

271271
ee.addListener('addStuff', adder);
@@ -295,7 +295,7 @@ By defined I mean, it has to have some other listener added to it, or you have t
295295
```javascript
296296
ee.defineEvents(['bar', 'baz']);
297297
ee.addListener(/ba[rz]/, function () {
298-
console.log('Now you are thinking with regular expressions.');
298+
console.log('Now you are thinking with regular expressions.');
299299
});
300300
ee.emitEvent(/ba[rz]/);
301301
```

docs/render.js

+39-39
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,43 @@ dust.helper = require('../node_modules/dustjs-helpers');
66

77
// Load the rendered template
88
fs.readFile('docs/api.dust.js', function(err, data) {
9-
// Throw any errors
10-
if(err) {
11-
throw err;
12-
}
13-
14-
// Load the rendered template into dust
15-
dust.loadSource(data);
16-
17-
// Load the data
18-
fs.readFile('docs/data.json', function(err, rawJSON) {
19-
// Throw any errors
20-
if(err) {
21-
throw err;
22-
}
23-
24-
// Parse the JSON
25-
var raw = JSON.parse(rawJSON);
26-
27-
// Build the data array
28-
var data = [];
29-
30-
// Loop over all JSDoc block
31-
for(var i = 0; i < raw.length; i += 1) {
32-
if (!raw[i].isPrivate && !raw[i].ignore) {
33-
data.push(raw[i]);
34-
}
35-
}
36-
37-
// Pipe the data into the template
38-
dust.render('api', data, function(err, out) {
39-
// Throw any errors
40-
if(err) {
41-
throw err;
42-
}
43-
44-
// Write the data to the output
45-
fs.writeFile('docs/api.md', out);
46-
});
47-
});
9+
// Throw any errors
10+
if(err) {
11+
throw err;
12+
}
13+
14+
// Load the rendered template into dust
15+
dust.loadSource(data);
16+
17+
// Load the data
18+
fs.readFile('docs/data.json', function(err, rawJSON) {
19+
// Throw any errors
20+
if(err) {
21+
throw err;
22+
}
23+
24+
// Parse the JSON
25+
var raw = JSON.parse(rawJSON);
26+
27+
// Build the data array
28+
var data = [];
29+
30+
// Loop over all JSDoc block
31+
for(var i = 0; i < raw.length; i += 1) {
32+
if (!raw[i].isPrivate && !raw[i].ignore) {
33+
data.push(raw[i]);
34+
}
35+
}
36+
37+
// Pipe the data into the template
38+
dust.render('api', data, function(err, out) {
39+
// Throw any errors
40+
if(err) {
41+
throw err;
42+
}
43+
44+
// Write the data to the output
45+
fs.writeFile('docs/api.md', out);
46+
});
47+
});
4848
});

0 commit comments

Comments
 (0)