#when do you stop injecting ?

1 messages ยท Page 1 of 1 (latest)

lucid sigil
#

I love the DI model of NestJS, think that it's very smart ๐Ÿ˜‰

However, at what point do you stop injecting and start using "new()" ?

Taking it to the extreme, you wouldn't inject a Date() , you would say const d = new Date()

I'm genuinely curious how and when people draw the line

dusk bear
#

Don't inject when the instance object needs to be changed (date, stream, etc)