Reputation: 65
The subscribe is never called, yet I increment and decrement.
this.store.select('counter').subscribe(counter => {
this.counter = counter;
console.log("subscribe", this.counter);
});
You can see my code on stackblitz to debug :
I don't understand, it's very strange.
Upvotes: 0
Views: 149
Reputation: 18879
Change this line in app.module.ts:
StoreModule.forRoot({ count: counterReducer }),
to:
StoreModule.forRoot({ counter: counterReducer }),
When you're subscribing, you're looking for the counter
but you had it registered as count
in your AppModule.
Upvotes: 1