Skip to content
This repository was archived by the owner on Sep 18, 2019. It is now read-only.

Setting up Ngrx Store with Ngrx Schematics #6

Open
wants to merge 1 commit into
base: 1-auth
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { environment } from '../environments/environment';
import {RouterStateSerializer, StoreRouterConnectingModule} from "@ngrx/router-store";

import { EffectsModule } from '@ngrx/effects';
import { reducers, metaReducers } from './reducers';
import { environment } from '../../environments/environment';


const routes: Routes = [
Expand Down Expand Up @@ -50,6 +52,8 @@ const routes: Routes = [
MatListModule,
MatToolbarModule,
AuthModule.forRoot(),
StoreModule.forRoot(reducers, { metaReducers }),
!environment.production ? StoreDevtoolsModule.instrument() : [],
],
providers: [],
bootstrap: [AppComponent]
Expand Down
19 changes: 19 additions & 0 deletions src/app/reducers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import {
ActionReducer,
ActionReducerMap,
createFeatureSelector,
createSelector,
MetaReducer
} from '@ngrx/store';
import { environment } from '../../environments/environment';

export interface AppState {

}

export const reducers: ActionReducerMap<AppState> = {

};


export const metaReducers: MetaReducer<AppState>[] = !environment.production ? [] : [];