developit / preact-redux

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

Updated TypeScript definitions and added tests #25

Closed arusanov closed 1 year ago

arusanov commented 6 years ago

From https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-redux Almost 1-1 (only tests changed a little). Should be pretty easy to port newer version of typings.

Known Issue: (which is true for this also) https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-redux/index.d.ts#L14-L19

There is a known issue in TypeScript, which doesn't allow decorators to change the signature of the classes they are decorating. Due to this, if you are using @connect() decorator in your code, you will see a bunch of errors from TypeScript. The current workaround is to use connect() as a function call on a separate line instead of as a decorator. Discussed in this github issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/20796