fix(ngrx-1): reducers missing from config

Due to a recent refactor of upgrading to Angular v16, the reducers weren't
copied over to the new `app.config.ts` file for the `ngrx-1` module.

Also fixed a minor spelling mistake in the related README.md file.
This commit is contained in:
Alan Dragicevich
2023-06-29 15:24:38 +12:00
parent f577efb1fc
commit c64c1f7283
3 changed files with 16 additions and 18 deletions

View File

@@ -16,7 +16,7 @@ In NgRx, **selectors** is a very powerful tool often **misused**. You should use
##### You will have to
1. Refactor this working exemple of a dashboard of activities.
1. Refactor this working example of a dashboard of activities.
##### Rules:

View File

@@ -4,6 +4,21 @@ import { provideEffects } from '@ngrx/effects';
import { ActivityEffects } from './store/activity/activity.effects';
import { UserEffects } from './store/user/user.effects';
import { StatusEffects } from './store/status/status.effects';
import {
activityFeatureKey,
activityReducer,
} from './store/activity/activity.reducer';
import { statusFeatureKey, statusReducer } from './store/status/status.reducer';
import { userFeatureKey, userReducer } from './store/user/user.reducer';
const reducers = {
[statusFeatureKey]: statusReducer,
[activityFeatureKey]: activityReducer,
[userFeatureKey]: userReducer,
};
export const appConfig: ApplicationConfig = {
providers: [
provideStore(reducers),

View File

@@ -4,27 +4,10 @@ import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import {
activityFeatureKey,
activityReducer,
} from './app/store/activity/activity.reducer';
import {
statusFeatureKey,
statusReducer,
} from './app/store/status/status.reducer';
import { userFeatureKey, userReducer } from './app/store/user/user.reducer';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
const reducers = {
[statusFeatureKey]: statusReducer,
[activityFeatureKey]: activityReducer,
[userFeatureKey]: userReducer,
};
bootstrapApplication(AppComponent, appConfig);