The Problem
export const mainStoreReducer: ActionReducer<State> = (state = intitialState, action: Action) => { switch (action.type) { case ActionTypes.AUTH_SUCCESS: { // TODO Implement reducer function for this action. break; } }
at MapSubscriber.project (http://localho…, context: DebugContext}
this.store.select(s => s.mainStoreReducer.userData) .subscribe((data: any) => { console.log('data is' + data) });
The Solution
case ActionTypes.AUTH_SUCCESS: { // TODO Implement reducer function for this action. return state; }
return Object.assign({}, state, { userData: { counter:action.payload.counter + 1} } )