Dependency injection #9
                  
                    
                      xhuberdeau
                    
                  
                
                  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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, first thank you for this repository!
I have a question about dependency injection at the view level: in the ProductList example, we have
const responseProducts = await productService(productRepositoryFake).getProducts();. That's ok for testing but not ok for the production code. How would you do to be able to switch between memory and prod implementations to be able to test your view easily?If we focus on a React app, would you have a context acting as some kind of dependencies container? That would mean:
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions