Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typings Error when using Redux 4.0.0 #521

Closed
2 of 9 tasks
kevinrjones opened this issue Apr 28, 2018 · 3 comments
Closed
2 of 9 tasks

Typings Error when using Redux 4.0.0 #521

kevinrjones opened this issue Apr 28, 2018 · 3 comments

Comments

@kevinrjones
Copy link

This is a...

  • feature request
  • bug report
  • usage question

What toolchain are you using for transpilation/bundling?

  • @angular/cli
  • Custom @ngTools/webpack
  • Raw ngc
  • SystemJS
  • Rollup
  • Other

Environment

NodeJS Version: 8.4.0
Typescript Version: 2.8.1 (but also tried on earlier version)
Angular Version: 5.2
@angular-redux/store version: 7.1.1
@angular/cli version: (if applicable) 1.7.4
OS: Mac OSX

I'm completely new to Redux and angular/redux and don't know if you are supporting Redux 4.0.0 yet but I'm seeing an issue when using 4.0.0

To reproduce:

Run ng new myapp
add references in package.json to Redux 4.0.0 and @angular-redux/store 7.1.1
in app.module.ts add
import { NgReduxModule } from "@angular-redux/store";

run ng build and you get the following error

ERROR in node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(37,14): error TS2416: Property 'dispatch' in type 'NgRedux<RootState>' is not assignable to the same property in base type 'ObservableStore<RootState>'.
  Type 'Dispatch<RootState>' is not assignable to type 'Dispatch<AnyAction>'.
    Type 'RootState' is not assignable to type 'AnyAction'.
node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(37,33): error TS2344: Type 'RootState' does not satisfy the constraint 'Action<any>'.
node_modules/@angular-redux/store/lib/src/components/root-store.d.ts(18,24): error TS2344: Type 'RootState' does not satisfy the constraint 'Action<any>'.

Tried this with Redux 3.7.2 and all works as expected. It looks like there are a few updates to the types in 4.0.0

@christikaes
Copy link

Duplicate of #519

@SethDavenport
Copy link
Member

Redux 4 introduced breaking changes to the typedefs. If you want to use angular-redux/store@7 you need to be on Redux 3.7.2

Conversely, if you want to be on Redux 4 you'll have to update the entire ecosystem:

  • @angular-redux/store@9
  • rxjs@6
  • redux@4

@cuni0716
Copy link

npm i -S redux works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants