Merge pull request #72 from AlDrag/fix-ngrx-1-reducers-missing

fix(ngrx-1): reducers missing from config
This commit is contained in:
Laforge Thomas
2023-06-29 08:58:11 +02:00
committed by GitHub
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 ##### 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: ##### Rules:

View File

@@ -4,6 +4,21 @@ import { provideEffects } from '@ngrx/effects';
import { ActivityEffects } from './store/activity/activity.effects'; import { ActivityEffects } from './store/activity/activity.effects';
import { UserEffects } from './store/user/user.effects'; import { UserEffects } from './store/user/user.effects';
import { StatusEffects } from './store/status/status.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 = { export const appConfig: ApplicationConfig = {
providers: [ providers: [
provideStore(reducers), provideStore(reducers),

View File

@@ -4,27 +4,10 @@ import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component'; 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'; import { environment } from './environments/environment';
if (environment.production) { if (environment.production) {
enableProdMode(); enableProdMode();
} }
const reducers = {
[statusFeatureKey]: statusReducer,
[activityFeatureKey]: activityReducer,
[userFeatureKey]: userReducer,
};
bootstrapApplication(AppComponent, appConfig); bootstrapApplication(AppComponent, appConfig);