使用@ angular-redux / store

时间:2018-05-02 06:59:11

标签: angular typescript redux angular-redux

在编译时遇到以下错误:

ERROR in node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(10,31): error TS2420: Class 'NgRedux<RootState>' incorrectly implements interface 'ObservableStore<RootState>'.
  Types of property 'dispatch' are incompatible.
    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>'.

环境设置:

NodeJS版本:8.9.1

打字稿版本:2.8.1

Angular Version:5.0.0

@ angular-redux / store version:7.1.1

操作系统:Windows 10

1 个答案:

答案 0 :(得分:1)

@ angular-redux / store github页面确认这是一个错误,将在以后的版本中修复。

将Redux版本从4.0.0降级到3.7.0解决了目前的问题。