Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
NGRX store is not instantiating in angular

I am working on a new project with NGRX store. NGRX store is not instantiating. When I use redux develop tool in chrome it always show me undefined. I have attached the intial structure of my ngrx store. Please let me know what is missing. Thank you

app.reducers.ts

import { ActionReducerMap, combineReducers } from '@ngrx/store';

import { PointReducers } from '../point/shared/store/point.reducers';
import { AppState } from './app.state';

export const appReducers: ActionReducerMap<AppState> = {
  point: combineReducers({
    closingTab: PointReducers.closingTab,
    configTab: PointReducers.configTab,
    postTab: PointReducers.postTab,
  })
};

app.state.ts

import { PointMainState } from '../point/shared/store/point-main.state';

export interface AppState {
  point: PointMainState;
}

store.index.ts

import { StoreModule } from '@ngrx/store';

export const StoreRootModuleIndex = [
  StoreModule.forRoot(
    {},
    {
      runtimeChecks: {
        strictStateImmutability: false,
        strictActionImmutability: false,
        strictStateSerializability: false,
        strictActionSerializability: false
      }
    }
  )
];

store.reducers.ts

import { Action, ActionReducer } from '@ngrx/store';

import { AppState } from './app.state';

export function storeMetaReducers(reducer: ActionReducer<any>) {
  return function (state: AppState | undefined, action: Action) {
    const newState = reducer(state, action);
    return newState;
  };
}

about 4 years ago ยท Santiago Gelvez
1 answers
Answer question

0

You have to add the reducers to the config. https://ngrx.io/guide/store/reducers#registering-root-state

export const StoreRootModuleIndex = [
  StoreModule.forRoot(
    // ๐Ÿ‘‡ add reducers here
    {},
    {
      runtimeChecks: {
        strictStateImmutability: false,
        strictActionImmutability: false,
        strictStateSerializability: false,
        strictActionSerializability: false
      }
    }
  )
];
about 4 years ago ยท Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!