Skip to content

Instantly share code, notes, and snippets.

@agutoli
Created November 8, 2017 14:34
Show Gist options
  • Save agutoli/4b539974749f8d7634414c0b9b832b68 to your computer and use it in GitHub Desktop.
Save agutoli/4b539974749f8d7634414c0b9b832b68 to your computer and use it in GitHub Desktop.
const dependencies = {
Axios: require('axios'),
UserRepository: require('./UserRepository'),
OtherUseCase: require('./OtherUseCase'),
}
async function MyUseCase (someParamId, injection) {
const {
Axios,
UserRepository,
OtherUseCase
} = Object.assign({}, dependencies, injection)
return UserRepository.findby(someParamId)
.then(OtherUseCase)
}
module.exports = MyUseCase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment