These are chat archives for AngularClass/angular2-webpack-starter
An Angular 2 Webpack Starter kit featuring Angular 2, Router, TypeScript, and Webpack by AngularClass
Hi all. I'd like to make an app with Angular 2 and Redux. How do practitioners of this starter use it with Redux?
From my view of other Angular2+Redux starters, I get the feeling that it totally changes the structure of an app from files being grouped by feature to being grouped by file type.
src src/app src/app/store src/app/store/feature1 src/app/store/feature1/feature1.actions.ts src/app/store/feature1/feature1.reducers.ts src/app/store/feature1/feature1.state.ts src/app/store/feature1/feature1.models.ts
*.models.tsonly when necessary
store, I have also:
both grouping the others respective feature files
app.state.tsto manage the HMR state, but it has nothing to do with the Redux’ app state interface… I suggest you to rename it to prevent confusion
src/app/storeas that defines the app’s global state
for example, you may have
and then your global state is:
so, just because some features will coincide in name with state keys, it doesn’t mean that’s a rule
townsis just a simple JS array with a couple of JS objects with data
:) in my example case:
buildingswould be used by
aggregationswould be used by
siteswould be used by
so, some state keys are used by multiple components or the other way around
ok. would this be more accurate then?
src/app src/app/store src/app/store/entityType1 src/app/store/entityType1/entityType1.actions.ts src/app/store/entityType1/entityType1.reducers.ts src/app/store/entityType1/entityType1.state.ts src/app/store/entityType1/entityType1.models.ts
src/app src/app/feature1 src/app/feature1/feature1.module.ts src/app/feature1/feature1.component.ts src/app/feature1/feature1.template.ts src/app/feature1/subfeature/ src/app/feature1/...
seamless-immutableis also better because it respects the exact object signature… you can use the arrays and objects with the exact same methods and they work perfectly, while with ImmutabeJS everything is different from standard
core… jsut about
shared, which we use… fair point about
core, yes, probably
storeshould be placed in there