Created
December 19, 2019 16:39
-
-
Save Noerdsteil/9b4c088f263205ebbfc1ccd82d080b12 to your computer and use it in GitHub Desktop.
How services are loaded before and after
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
// Contructor based DI (intermediary solution we had before) | |
const UserService = require('../user/userService') | |
const userService = new UserService(crmService, lhNotifier, userPropertyService) | |
// Note: All of the required services had to be managed in each occurrence | |
// Consistency was not the only pain we had | |
// With DI container in place | |
const { container, types } = require('../dependencyContainer') | |
const userService = container.get(types.UserService) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment