-
Notifications
You must be signed in to change notification settings - Fork 18
Convert namespace from aspect to argument in service layer #143
Comments
relates to #146 (comment) - I wonder if we can use DI to inject the namespace from the route; using route specific injections? This would avoid the need to use |
also if we injected the namespace using the router; we could then look at adding more caching between related pages in the same namespace maybe? |
I just want to be able to call the service layer, passing in the namespace to look at. |
yeah - we can maybe just put the ActiveRoute thingy on the observer producer objects and keep the services super simple? |
I think if the observer producers only extracted the namespace from the activeroute and then called in to the service layer, that would work well. There is currently some useful functionality in the observer producer (aka store) layer (e.g. attaching a watcher, the loading stuff) that should move up in to the service layer - IOW the observer producer layer is simply a really thin facade that sets the right namespace. WDYT? |
yeah - sounds fine to me. Plus folks could compose the observable producers maybe with a different |
Right now the namespace is injected and stored in both the stores and the services, which makes them very hard to reuse as composable services.
This happens via the NamespacedResourceService and NamespacedResourceStore.
Instead of injecting the namespace into a parent class, it would be better if operations like loadAll took an argument of namespace: Observable allowing the consumer to explicitly choose the namespace.
Relates to:
The text was updated successfully, but these errors were encountered: