-
Notifications
You must be signed in to change notification settings - Fork 18
Remove store layer #146
Comments
in what way? :) |
the store just provides Observble<T> for some entities and an Observable<boolean> loading indicator together with the API to mutate entities - what else did you have in mind? |
I don't like storing the observables like that in an singleton, it feels very dangerous to me, I would prefer the method to just return the stream - it feels to me like trying to jam a request scope in, and after many years of building request scopes, I think they aren't good. I'm also not a huge fan of deep object hierarchies so I would probably just collapse the store layer in to the service layer making both stateless (well, session/app scope is fine, just not a pseudo-request). |
They're not singletons btw - just things you inject into components; but yeah I don't like the name 'store' at all really either :) But we need a name for the objects which compose other service/streams to make composite view/stream/thingies. Naming is hard though! BTW its kinda hard to pass in things like 'namespace' as parameters into the service layer as the For example we should have a thing that contains an |
Maybe we reuse DI terminology - we're really just referring to Observable producers. Little objects you can inject into your component which own/manage one or more observables? e.g. someting like... export class MyComponent {
constructor(protected podsProducer: ObservablePodsProducer) {}
....
Observable<Pods>pods = this.podsProducer.entities;
Observable<boolean> loading = this.podsProducer.loading; then the I guess another approach to the |
export class Namespaces {
current(): Observable<Namespace> {
throw new Error('No provider is registered for Namesapces');
}
} export class NamespacesService extends Namespaces {
constructor() {}
current(): Observable<Namespace> {
return actuallyLoadTheNameSpaceForTheCurrentRoute();
}
} And then you can pass to the 'service layer' WDYT? |
sounds good |
The store layer is not compatible with reactive programming.
The text was updated successfully, but these errors were encountered: