Last active
May 22, 2017 14:12
-
-
Save pjchender/e44b45d12d6ab1c52bc141ca1c3c1580 to your computer and use it in GitHub Desktop.
[Node][Unit34] Putting string variable in configuration.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Emitter = require('events') | |
const eventsConfig = require('./config').events | |
let emtr = new Emitter() | |
emtr.on(eventsConfig.GREET, function () { | |
console.log('Somewhere, someone said hello') | |
}) | |
emtr.on(eventsConfig.GREET, function () { | |
console.log('A greeting occurred') | |
}) | |
console.log('Hello') | |
emtr.emit(eventsConfig.GREET) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
events: { | |
GREET: 'greet', | |
SAVE_FILE: 'saveFile' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment