Created
August 2, 2019 22:48
-
-
Save jonathansamines/69d51f7814113e04dc12ba451fe1b7f5 to your computer and use it in GitHub Desktop.
inversion-control
This file contains 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
// initialize server | |
import Service from './service'; | |
server.route({ | |
method: 'GET', | |
config: { | |
handler() { | |
const service = new Service(); | |
request.registerPodium(service.events); | |
return service.getSomething(); | |
} | |
}, | |
}); |
This file contains 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
export default class Service { | |
events = new Podium() | |
getSomething() { | |
this.events.log('evento', { a: 'value' }); | |
return Promise.resolve(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment