Dependency injection (typed-inject) #10105
danielbayley80
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wondering if there is a strategy for DI with Svelte. I'm using typed-inject.
I have a simple example below where I have my pre-constructed injector which I use to resolve the service for the "controller".
In express, my controller classes would accept an iSiteService interface in to the constructor in to which I can inject a mocked service.
What I have for Svelte has a bit of a bad smell to it and I am wondering if there is a better way to do it so I can make it more testable?
Beta Was this translation helpful? Give feedback.
All reactions