How I Do Dependency Injection With Closures

from blog Jonathan's Blog, | ↗ original
You can also find an edited and updated version of this post that I wrote for my employer’s blog here. A discussion came up on Reddit recently about DI, where I mentioned that one way that I’ve done DI recently for web frameworks that don’t naturally support it to using closures. Someone asked for an example, so I figured I’d explain what that...