developit / preact-redux

:loop: Preact integration for Redux (no shim needed!)
https://npm.im/preact-redux
MIT License
288 stars 27 forks source link

Error with redux 4.0.0: Type 'S' does not satisfy the constraint 'Action<any>' #32

Open greengiraffe opened 6 years ago

greengiraffe commented 6 years ago

Using Redux 4.0.0 some errors occur while bundling a typescript/preact/preact-redux project.

Versions I'm using:

preact-redux@2.0.3
redux@4.0.0"

The errors:

ERROR in [at-loader] ./node_modules/preact-redux/src/preact-redux.d.ts:19:23
    TS2344: Type 'S' does not satisfy the constraint 'Action<any>'.

ERROR in [at-loader] ./node_modules/preact-redux/src/preact-redux.d.ts:214:25
    TS2344: Type 'S' does not satisfy the constraint 'Action<any>'.

I found a similar issue here: https://github.com/redux-observable/redux-observable/issues/449

4lph4-Ph4un commented 6 years ago

Is there a fix coming? :)

greengiraffe commented 5 years ago

@4lph4-Ph4un you can checkout my PR/Fork that fixes the issue: https://github.com/greengiraffe/preact-redux/commit/e8a6835ece497b3339f24eb5ce053645b2785ff1

4lph4-Ph4un commented 5 years ago

Ah excellent, thank you! :) is there a plan to integrate this into the master? I can patch that for my project that way, but just curious about its ETA :)

pmkroeker commented 5 years ago

Any plans on merging this? Would be super helpful instead of having to manually enter the changes in whenever I install it.

developit commented 5 years ago

Apologies! I'm not a redux or TypeScript user so I haven't been bitten by these issues yet. I'll take a look at the PR.

developit commented 5 years ago

I've merged the various PR's for type changes. Would you be able to test against master and see if the issues are fixed @greengiraffe @4lph4-Ph4un or @pmkroeker? Cheers.

pmkroeker commented 5 years ago

Just tested and it looks like its cleared all of the conflicts that I was having. Thanks @developit!

greengiraffe commented 5 years ago

@developit Thanks for merging. I switched from Preact to React for other reasons so I can't test against master right now. I assume that if it works for @pmkroeker it will be fine.

sanpoChew commented 5 years ago

@developit would there be any chance of popping this out in a release? 🙏

developit commented 5 years ago

Yup.