Skip to content
New issue

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

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

Already on GitHub? # to your account

Compiler Error when implementing Redux-Thunk Action #559

Open
2 of 9 tasks
mkschnitzel opened this issue May 24, 2019 · 0 comments
Open
2 of 9 tasks

Compiler Error when implementing Redux-Thunk Action #559

mkschnitzel opened this issue May 24, 2019 · 0 comments

Comments

@mkschnitzel
Copy link

mkschnitzel commented May 24, 2019

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: 10.15.3
Typescript Version: 3.2.4
Angular Version: 7.2.15
@angular-redux/store version: 10.0.0
@angular/cli version: 7.3.9
OS: Win7

Link to repo showing the issus

(optional, but helps a lot)

Expected Behaviour:

Implemented Redux-Thunk (2.3.0)
Called a redux-thunk-action via dispatch
No compiler errors

Actual Behaviour:

Compiler error

Stack Trace/Error Message:

TS2345 (TS) Argument of type '(dispatch: any, getState: any) => void' is not assignable to parameter of type 'AnyAction'.
Property 'type' is missing in type '(dispatch: any, getState: any) => void' but required in type 'AnyAction'.

Additional Notes:

Workaround: Cast the returning function of the redux-thunk-action as <AnyAction><any>
Example:
return <AnyAction><any>((dispatch, getState) => { ..... }

This seemed to be fixed #390 a while ago,
but might have been broken again in commit 5ab400f#diff-0d3376051b12933294267bc5c76dac1c

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

No branches or pull requests

1 participant