You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do a lot of Angular development, and one thing I miss from Angular is dependency injection - having all my service calls in a service class that can be shared by components. Currently I have service calls in my components that I share via context or by updating a store. I feel like it would be better and easier to reason about using a service in my components that provides methods that make all the network calls, and I can update stores from within those same methods.
I'm leaving out the issue of easily getting store values outside of svelte components, because I know runes address this, but it is a bit of a hurdle currently. Has anyone established a good pattern for having external files for making network calls? Just curious what others have done. Thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I do a lot of Angular development, and one thing I miss from Angular is dependency injection - having all my service calls in a service class that can be shared by components. Currently I have service calls in my components that I share via context or by updating a store. I feel like it would be better and easier to reason about using a service in my components that provides methods that make all the network calls, and I can update stores from within those same methods.
I'm leaving out the issue of easily getting store values outside of svelte components, because I know runes address this, but it is a bit of a hurdle currently. Has anyone established a good pattern for having external files for making network calls? Just curious what others have done. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions