DEV Community

Discussion on: Dependency Injection /Services pattern for React (inspired by Angular)

Collapse
 
gobieljonathan profile image
Jonathan Gobiel

yeah i mean, if so much context have been made, it could make hell provider, can you tell, how to void ?

Thread Thread
 
dansolhan profile image
Daniel Sollie Hansen

If I get you correctly, you're worried that you'll clog the template with services? My solution to this was to put all Services inside a GlobalServices that is then wrapped around the App. Does that answer your question?

Thread Thread
 
gobieljonathan profile image
Jonathan Gobiel

yeah it's good solution, but there's any approach method to make Dependecy Injection without using context?

Thread Thread
 
dansolhan profile image
Daniel Sollie Hansen

I'd assume so! If you check my comments, you can see that Jack has made a solution that seems very viable!