Toggle navigation
Toggle navigation
This project
Loading...
Sign in
I_Jemin
/
Node-Study
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
I_Jemin
2018-03-21 23:49:18 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
69e2f3470767cdd7c3ed9644ad615c38d95790c2
69e2f347
1 parent
b2a99c86
Event Argument
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
app.js
app.js
View file @
69e2f34
const
log
=
require
(
'./logger'
)
const
EventEmitter
=
require
(
'events'
);
const
emitter
=
new
EventEmitter
();
// Register a listener
emitter
.
on
(
'messageLogged'
,
function
(
arg
)
{
// e, eventArg
console
.
log
(
'Listener called'
,
arg
);
});
emitter
.
emit
(
'messageLogged'
,
{
id
:
1
,
url
:
'http://'
});
log
(
'message'
);
\ No newline at end of file
...
...
Please
register
or
login
to post a comment