angular-redux / store

Angular 2+ bindings for Redux
MIT License
1.34k stars 205 forks source link

Wrong sample code in Beginners' Tutorial #524

Closed vukmandavid closed 6 years ago

vukmandavid commented 6 years ago

This is a...

What toolchain are you using for transpilation/bundling?

The sample code at Generating Actions in Beginners' Tutorial is wrong.

The wrong part

 constructor(                        
    private ngRedux: NgRedux<IAppState>,   //<-- IAppState
    private actions: CounterActions) { 
  }   

  increment() {
    this.ngRedux.dispatch(this.actions.increment());  //<--Return type of increment is Action
  }

  decrement() {
    this.ngRedux.dispatch(this.actions.decrement());   //<--Return type of decrement is Action
  }

The TypeScript error: Argument of type 'Action' is not assignable to parameter of type 'IAppState'. Property 'count' is missing in type 'Action'.

vukmandavid commented 6 years ago

It's not the guide but the ts def file