Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
One possible way of doing configuration with DI. I think we need something nicer...
function Config() {
this.useFoo = false;
this.log = 'infoo;
class SomeService{
constructor(config) {
// ...
// Using a different config
function DebugConfig() {
this.useFoo = true;
this.someBar = 1111;
var injector = new Injector([DebugConfig]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment