Create root app state module
This commit is contained in:
parent
0b2bfa8406
commit
c452fbc5ef
3 changed files with 17 additions and 0 deletions
|
@ -1,15 +1,23 @@
|
|||
import {
|
||||
ApplicationConfig,
|
||||
importProvidersFrom,
|
||||
isDevMode,
|
||||
provideBrowserGlobalErrorListeners,
|
||||
provideZonelessChangeDetection,
|
||||
} from '@angular/core';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
import { provideStoreDevtools } from '@ngrx/store-devtools';
|
||||
import { appStateReducer } from './state/state.reducer';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideBrowserGlobalErrorListeners(),
|
||||
provideZonelessChangeDetection(),
|
||||
importProvidersFrom(
|
||||
StoreModule.forRoot({
|
||||
app: appStateReducer,
|
||||
})
|
||||
),
|
||||
provideStoreDevtools({
|
||||
maxAge: 25,
|
||||
logOnly: !isDevMode(),
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { StoreModule } from '@ngrx/store';
|
||||
import { appStateReducer } from './state/state.reducer';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
|
|
7
src/app/state/state.reducer.ts
Normal file
7
src/app/state/state.reducer.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { createReducer } from '@ngrx/store';
|
||||
|
||||
export interface AppState {}
|
||||
|
||||
export const initialState: AppState = {};
|
||||
|
||||
export const appStateReducer = createReducer(initialState);
|
Loading…
Add table
Reference in a new issue