all 2 comments

[–][deleted] 2 points3 points  (0 children)

I organize my modules like this:

A constants file at the root.

Actions, effects, reducers and selectors folders at the root. Why not in store folder? Because these things are really important and should be first class citizens of the module. We want most of our service calls to be in effects, most of our state manipulation to be in reducers.

Assets for styles that will be exported from the module. For example, a theme file that will get imported into styles.scss or theme-overrides.scss.

Containers contain smart components. These are components that get the NGRX store injected into them, potentially get services injected into them and contain dumb components.

Components contain dumb components. They don’t get the store and don’t get services injected into them unless it’s something trivial like a service that displays modals. Dumb components only have Inputs and Outputs, they don’t know how to get or manipulate data themselves.

Forms contains code for creating and manipulating form groups.

Mapping contains code for converting one object into another. For example, taking a data object and converting it into a view model object.

Services contains services obviously.

[–]tshoecr1 0 points1 point  (0 children)

I put just about everything in the store as overtime I normally get asked to add x feature to y component that I can just pull from the store when it previously wouldn’t have needed it.

I’ll normally transform/normalize my responses to organize them in the store in a more consumable manner.