These are chat archives for AngularClass/angular2-webpack-starter

9th
Oct 2016
Dan Cancro
@dancancro
Oct 09 2016 19:06
@marinho in an Angular Redux app, where do you think services that get data should go? The Google Tour of Heroes puts such things into src/app/my-feature/my-feature.service.ts. The ngrx example app puts them into src/app/services. The angular2-webpack-starter puts them in src/app/my-feature/my-feature.service.ts. I'm thinking that database communication is more connected to the store than the UI and so it should go in src/app/core/store/my-feature/my-feature.service.ts among the other store files.
Marinho Brandão
@marinho
Oct 09 2016 20:12

hi @dancancro in my case, I used Swagger to generate an API client and that’s the only API service I have. It is generated outside of src by a postinstall npm entry.

Indeed the service is anyhow closer to the application state, but I don’t see them together, as the app state include other stuff that aren’t coming from API, such as calculated values, temporary stuff, cached data, user interactions, etc… I’d better keep the API service in something like src/app/services

Dan Cancro
@dancancro
Oct 09 2016 20:15
thanks. i've started thinking of the store as the local backend. i wonder if that'll catch on :smile:
pigeont
@PigeonT
Oct 09 2016 20:24
@PigeonT
can i use materialze for free?
I need some help!
any one there?
Marinho Brandão
@marinho
Oct 09 2016 20:26

@dancancro I think the idea of a “global app state” is quite plastic. I think most of it is like a local backend, indeed, but not completely, and you probably will find people with different understandings implementing it in different ways.

I’m not very experient on Redux either, so, I’m always curious to see how other people are doing too