Hel_UI
Hel_UI

Reputation: 115

current state in ngrx angular

Hi new to ngrx i am trying implement a smaple example for ngrx with angular but i have implemented everything not able to get the current state after service call

So can please help me to get the current state and how many to get the state in ngrx as newbie to ngrx and correct if there are coding needs to improved in other places

I have added the stackblitz link

https://stackblitz.com/edit/angular-gvjoju

Upvotes: 1

Views: 90

Answers (1)

timdeschryver
timdeschryver

Reputation: 15505

The reducers added to StoreModule.forRoot() must be an actionmap, for example:

   StoreModule.forRoot({data : TestReducer.TestReducer}),

The reducer should always have a default case to return the current state:

  default:
        return state

Upvotes: 1

Related Questions