UNPKG
glot
Version:
latest (0.1.9)
1.0.0
0.1.9
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
EventEmitter with Promises and Generators
github.com/joe-singer/glot
joe-singer/glot
glot
/
src
/
examples
/
emit.js
11 lines
(8 loc)
•
239 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
'use strict'
const
Glot
=
require
(
'../lib/glot'
);
let
events =
new
Glot
(); events.
on
(
'foo'
,
function
(
data
){
console
.
log
(
'once foo plain:'
, data) }); events.
emit
(
'foo'
, {
emit
:
'foo1'
}); events.
emit
(
'foo'
, {
emit
:
'foo2'
});