Enterprise-Angular-Applications-With-NgRx-and-Nx-Book icon indicating copy to clipboard operation
Enterprise-Angular-Applications-With-NgRx-and-Nx-Book copied to clipboard

Chapter 10 - NgRx has missing imports/exports that are difficult to guess

Open samspot opened this issue 4 years ago • 1 comments

Hi, great book so far! I've been able to get everything working up to this point. I think a small update to this file in chapter 10 would enhance the book.

counter.action.ts is missing the import for createAction. I believe it should be import { Action, createAction } from '@ngrx/store';

counter.action.ts does not export anything for CounterActions which are later used in counter.reducer.ts I've had no success figuring this one out and wasn't able to complete the exercise.

samspot avatar Jan 04 '21 21:01 samspot

I think I encountered this issue also. My notes show that there is a CounterState and a AppState interface. It doesn't seem right to have to type state.counter.counter.

The official example counter code and Duncan's code have some differences. They border on pseudo code and serve mainly to introduce the key concepts of NgRx which are used in the following sections of the "Enterprise" implementation, so you shouldn't let this error stop you progressing to the next section.

I did write a blog post my self about implementing the official counter example in an Nx/Angular setting. Not sure if you're still at this stage anymore. I wish I saw this issue earlier as I might have been able to help.

timofeysie avatar May 11 '21 11:05 timofeysie