Created
June 6, 2017 01:13
-
-
Save axelav/2d9608c33dff467209a14d58cf780b87 to your computer and use it in GitHub Desktop.
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 = function bar (bus) { | |
setInterval(() => { | |
bus.emit('foo', {bar: [69, 69, 69]}) | |
}, 6900) | |
bus.on('bar', data => { | |
console.log('foo', data) | |
}) | |
} |
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 = function foo (bus) { | |
setInterval(() => { | |
bus.emit('bar', {bar: [420, 420, 420]}) | |
}, 4200) | |
bus.on('foo', data => { | |
console.log('foo', data) | |
}) | |
} |
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 foo = require('./foo') | |
const bar = require('./bar') | |
const nanobus = require('nanobus') | |
const bus = nanobus() | |
foo(bus) | |
bar(bus) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment