Skip to content

Error on redux.dispatch #519

Closed
Closed
@danieldaeschle

Description

@danieldaeschle

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.11.1
Typescript Version: 2.4.2
Angular Version: 5.0.0
@angular-redux/store version: 7.1.1
@angular/cli version: 1.7.4
OS: Ubuntu 16.04

Expected Behaviour:

It should work 😆

Actual Behaviour:

This message on compiling:

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>'.
src/app/actions/note.ts(15,31): error TS2345: Argument of type '{ type: string; payload: Note; }' is not assignable to parameter of type 'IAppState'.
  Object literal may only specify known properties, and 'type' does not exist in type 'IAppState'.
src/app/actions/note.ts(19,31): error TS2345: Argument of type '{ type: string; payload: Note; }' is not assignable to parameter of type 'IAppState'.
  Object literal may only specify known properties, and 'type' does not exist in type 'IAppState'.
src/app/components/notedesk/notedesk.component.ts(2,32): error TS2307: Cannot find module '../shared/article.service'.
src/app/components/notedesk/notedesk.component.ts(3,25): error TS2307: Cannot find module '../shared/models/article'.

Additional Notes:

image
image
image

Message transalted from german:

The argument of type "{ type: string; payload: Note; }" cannot be assigned to the "IAppState" type parameter.
  The object literal can only specify known properties, and "type" is not available in the "IAppState" type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions