Type inference without dependencies
Heyo, I'm finally getting around to moving things into Layers and Services.
In our current setup we define a service and then have a separate file for every single method. We use type inferance so the parameters of the method are automatically typed. We love setting the type of the function so we see errors in the file where we define the implementation itself, instead of only in the layer where we define the layer itself.
If I use something like this:
But use a dependency in the method implementation itself the type of the function obviously contains the dependency in the type. Which makes typescript give me a type error saying that the function type doesn't match.
Is there a way to make typescript scream at me for writing the wrong implementation but still having the dependencies bubble up?
I hope I gave enough context, if any more info is needed let me know :)
In our current setup we define a service and then have a separate file for every single method. We use type inferance so the parameters of the method are automatically typed. We love setting the type of the function so we see errors in the file where we define the implementation itself, instead of only in the layer where we define the layer itself.
If I use something like this:
Context.Tag.Service<SomeService>["someMethod"]But use a dependency in the method implementation itself the type of the function obviously contains the dependency in the type. Which makes typescript give me a type error saying that the function type doesn't match.
Is there a way to make typescript scream at me for writing the wrong implementation but still having the dependencies bubble up?
I hope I gave enough context, if any more info is needed let me know :)
