Create root app state module

This commit is contained in:
Z. Charles Dziura 2025-06-30 20:47:02 -04:00
parent 0b2bfa8406
commit c452fbc5ef
3 changed files with 17 additions and 0 deletions

View file

@ -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(),

View file

@ -1,4 +1,6 @@
import { Component } from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { appStateReducer } from './state/state.reducer';
@Component({
selector: 'app-root',

View file

@ -0,0 +1,7 @@
import { createReducer } from '@ngrx/store';
export interface AppState {}
export const initialState: AppState = {};
export const appStateReducer = createReducer(initialState);