Skip to content

Is there any reason why I should not register all my dependencies at Shiny Startup? #965

Answered by aritchie
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

There is nothing wrong with what you are doing as long as you don't have a massive dependency chain that takes too long to validate that it cuts into the background startup.

You can also do a services.AddSingleton(_ => ShinyHost.Resolve()) to register with your secondary container.

Lastly, you can look at Shiny.Framework which uses DryIoc (a mutable container).

The following samples may help:
https://github.com/shinyorg/samples/tree/main/Integration-Best-Prism-RXUI
https://github.com/shinyorg/samples/tree/main/Integration-Prism

With these samples, you'll notice a distinct separation between viewmodel registration (which is still DI) and services/shiny yet it is all in one container.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected by aritchie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant